#ifndef morpheo_ToBase2
#define morpheo_ToBase2

/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include <sstream>
using namespace std;

namespace morpheo              {

  inline string toBase2 (uint32_t value, uint32_t size)
  {
    ostringstream res;
    uint32_t      mask = 1<<(size-1);

    while (mask != 0)
      {
	res  << ((value&mask)?'1':'0');
	mask >>= 1;
      }

    return res.str();
  }
  
}; // end namespace morpheo              

#endif
