lib/bitString.js
function randomBits (n) {
  if (typeof n !== 'number') throw new Error('bitString#randomBits: Need number');
  var buf = _randomBytes(Math.ceil(n/8)),
      bits = '';
  for (var i = 0; i < n; i++) {
    bits += (buf[Math.floor(i / 8)] & (0x01 << (i % 8))) ? '1' : '0';
  }
  return bits;
}
function randomBits (n) {
  if (typeof n !== 'number') throw new Error('bitString#randomBits: Need number');
  var buf = _randomBytes(Math.ceil(n/8)),
      bits = '';
  for (var i = 0; i < n; i++) {
    bits += (buf[Math.floor(i / 8)] & (0x01 << (i % 8))) ? '1' : '0';
  }
  return bits;
}
function randomBits ( n ) { if ( typeof n !== 'number' ) throw new Error ( 'bitString#randomBits: Need number' ) ; var buf = _randomBytes ( Math . ceil ( n / 8 ) ) , bits = '' ; for ( var i = 0 ; i < n ; i ++ ) { bits += ( buf [ Math . floor ( i / 8 ) ] & ( 0x01 << ( i % 8 ) ) ) ? '1' : '0' ; } return bits ; }
Get n random bits 
Get N randomBits as bitstring
@param  {integer} n Number of random bits to get
@return {string}   The random bitstring
Get n random bits Get N randomBits as bitstring