src/crypto.js
function randomHexString(size) {
  if (size === 0) {
    throw new Error('Zero-length randomHexString is useless.');
  }
  if (size % 2 !== 0) {
    throw new Error('randomHexString size must be divisible by 2.');
  }
  return crypto.randomBytes(size / 2).toString('hex');
}
function randomHexString(size) {
  if (size === 0) {
    throw new Error('Zero-length randomHexString is useless.');
  }
  if (size % 2 !== 0) {
    throw new Error('randomHexString size must be divisible by 2.');
  }
  return crypto.randomBytes(size / 2).toString('hex');
}
function randomHexString ( size ) { if ( size === 0 ) { throw new Error ( 'Zero-length randomHexString is useless.' ) ; } if ( size % 2 !== 0 ) { throw new Error ( 'randomHexString size must be divisible by 2.' ) ; } return crypto . randomBytes ( size / 2 ) . toString ( 'hex' ) ; }
Returns a new random hex string of the given even size.
Returns a new random hex string of the given even size .