function generateRandomNumber(bits = 256) {
  // generate the random number in hex
  const base16Result = randomBytes(bits / 8).toString('hex')

  // convert hex number to decimal & binary
  const base10Result = BigNumber(`0x${base16Result}`).toString(10)
  const base2Result = BigNumber(`0x${base16Result}`).toString(2)

  return {
    base16: base16Result,
    base10: base10Result,
    base2: base2Result,
  }
}
/**
 * Generates a cryptographically-secure pseudo-random number
 *
 * @property {Number} [bits=256] - number of bits to generate a random number
 *
 * @returns {RandomNumber} - Returns an object containing a random number to different bases
 */
Generates a cryptographically-secure pseudo-random number
@property {Number} [bits=256] - number of bits to generate a random number

@returns {RandomNumber} - Returns an object containing a random number to different bases
Generates a cryptographically - secure pseudo - random number @property { Number } [ bits = 256 ] - number of bits to generate a random number @returns { RandomNumber } - Returns an object containing a random number to different bases
function generateRandomNumber(bits = 256) {
  const base16Result = randomBytes(bits / 8).toString('hex')
  const base10Result = BigNumber(`0x${base16Result}`).toString(10)
  const base2Result = BigNumber(`0x${base16Result}`).toString(2)
  return {
    base16: base16Result,
    base10: base10Result,
    base2: base2Result,
  }
}
function generateRandomNumber ( bits = 256 ) { const base16Result = randomBytes ( bits / 8 ) . toString ( 'hex' ) const base10Result = BigNumber ( ` ${ base16Result } ` ) . toString ( 10 ) const base2Result = BigNumber ( ` ${ base16Result } ` ) . toString ( 2 ) return { base16 : base16Result , base10 : base10Result , base2 : base2Result , } }
Generates a cryptographically-secure pseudo-random number
 @property {Number} [bits=256] - number of bits to generate a random number
Generates a cryptographically - secure pseudo - random number @property { Number } [ bits = 256 ] - number of bits to generate a random number
// generate the random number in hex // convert hex number to decimal & binary