Generates strong pseudo-random bytes sync.

@param {number} size
@return {Buffer}
@public
13812
function randomBytesSync (size) {
  var err = null

  for (var i = 0; i < GENERATE_ATTEMPTS; i++) {
    try {
      return crypto.randomBytes(size)
    } catch (e) {
      err = e
    }
  }

  throw err
}
1107244
function byteSizeFormat(num, base, toFixed, noSpace) {
  if (typeof num !== 'number') {
    throw new TypeError('Expected a number');
  }

  var neg = num < 0 ? '-' : '';

  if (neg) {
    num = -num; // short Math.abs
  }
  if (num < 1) {
    return neg + num + ' B';
  }
  if (typeof base !== 'number' || base < 0) {
    base = 1024;
  }
  if (typeof num !== 'number' || toFixed < 0) {
    toFixed = 2;
  }

  var exponent = Math.min(Math.floor(Math.log(num) / Math.log(base)), units.length - 1);

  num = (num / Math.pow(base, exponent)).toFixed(toFixed);
  return neg + num + (noSpace ? '' : ' ') + units[exponent];
}
1350891
def randombytes(size):
    
    buf = ffi.new("unsigned char[]", size)
    lib.randombytes(buf, size)
    return ffi.buffer(buf, size)[:]
815545
protected IntBuffer createIntBuffer(int size) {
      ByteBuffer temp = ByteBuffer.allocateDirect(4 * size);
      temp.order(ByteOrder.nativeOrder());

      return temp.asIntBuffer();
    }
863356
function fetch (size) {
		size = size || samplesPerFrame;

		let output = data.copy(0, size)
		data.consume(size)

		//if size is too small, fill with silence
		if (!output.length) {
			return silence
		}
		else if (output.length < size) {
			output = util.pad(output, size)
		}

		return output;
	}
1018848
async function getFileSize(file) {
  const data = await readFileAsync(file, 'utf-8');
  return {
    fileSize: fileSize(Buffer.byteLength(data)),
    gzipSize: fileSize(await gzipSize(data))
  };
}
1342077
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');
}
510008
public static byte[] getByteArray(int size)
    {
        byte[][] pool = (byte[][])__pools.get();
        boolean full=true;
        for (int i=pool.length;i-->0;)
        {
            if (pool[i]!=null && pool[i].length==size)
            {
                byte[]b = pool[i];
                pool[i]=null;
                return b;
            }
            else
                full=false;
        }

        if (full)
            for (int i=pool.length;i-->0;)
                pool[i]=null;
        
        return new byte[size];
    }
248764
function (value, length, pad) {
        return _gpfToBaseANY(_gpfB16, value, {
            length: length,
            pad: pad
        });
    }
593457
function(length) {
      var bytes, hex;
      if (length == null) {
        length = 32;
      }
      length /= 2;
      bytes = this.randomBytes(length);
      return hex = this.toHex(bytes).toUpperCase();
    }
374636
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)
    })
  })
}
664955
public static byte[] fold(byte[] bytes, int size) {
        byte[] r = new byte[size];
        for (int i=Math.max(bytes.length,size)-1; i>=0; i-- ) {
            r[i%r.length] ^= bytes[i%bytes.length];
        }
        return r;
    }
559818
private byte[] shrinkBuffer(byte[] buffer, int size)
    {
        if (size == 0) {
            return null;
        }

        if (size == buffer.length) {
            return buffer;
        }

        byte[] output = new byte[size];
        System.arraycopy(buffer, 0, output, 0, size);
        return output;
    }
1290008
function ByteBuffer(size) {
                /*private*/ this.bigEndian = true;
                this.bytes = null;
                this.cursor = 0;
                this.bytes = (function (s) { var a = []; while (s-- > 0)
                    a.push(0); return a; })(size);
                this.cursor = 0;
            }
1238111
public byte[] ensureBufferHasCapacityLeft(int size) throws FileParsingException {
    if (bytesHolder == null) {
      bytesHolder = new ByteArrayHolder(size);
    } else {
      bytesHolder.ensureHasSpace(size);
    }
    return bytesHolder.getUnderlyingBytes();
  }
145409
function(n) {
      for (var bytes = []; n > 0; n--)
        bytes.push(Math.floor(Math.random() * 256));
      return bytes;
    }
888288
function _random_number_helper($size)
    {
        if (function_exists('crypt_random_string')) {
            $random = crypt_random_string($size);
        } else {
            $random = '';

            if ($size & 1) {
                $random.= chr(mt_rand(0, 255));
            }

            $blocks = $size >> 1;
            for ($i = 0; $i < $blocks; ++$i) {
                // mt_rand(-2147483648, 0x7FFFFFFF) always produces -2147483648 on some systems
                $random.= pack('n', mt_rand(0, 0xFFFF));
            }
        }

        return new Math_BigInteger($random, 256);
    }