docs: function randomBytes (size, callback) {
    // validate callback is a function, if provided
    if (callback !== undefined && typeof callback !== 'function') {
      throw new TypeError('argument callback must be a function')
    }
  
    // require the callback without promises
    if (!callback && !global.Promise) {
      throw new TypeError('argument callback is required')
    }
  
    if (callback) {
      // classic callback style
      return generateRandomBytes(size, GENERATE_ATTEMPTS, callback)
    }
  
    return new Promise(function executor (resolve, reject) {
      generateRandomBytes(size, GENERATE_ATTEMPTS, function onRandomBytes (err, str) {
        if (err) return reject(err)
        resolve(str)
      })
    })
  }