src/Generator/OpenSSLGenerator.php
public function generate($byteCount)
    {
        $bytes = '';

        if (self::isSupported()) {
            $sslStrong = false;
            $sslBytes = openssl_random_pseudo_bytes($byteCount, $sslStrong);
            if ($sslStrong) {
                $bytes = $sslBytes;
            }
            unset ($sslStrong);
        }

        return str_pad($bytes, $byteCount, chr(0));
    }
public function generate($byteCount)
    {
        $bytes = '';

        if (self::isSupported()) {
            $sslStrong = false;
            $sslBytes = openssl_random_pseudo_bytes($byteCount, $sslStrong);
            if ($sslStrong) {
                $bytes = $sslBytes;
            }
            unset ($sslStrong);
        }

        return str_pad($bytes, $byteCount, chr(0));
    }
Generate a string of random data.

@param  integer $byteCount The desired number of bytes.
@return string  Returns the generated string.