src/fkooman/IO/IO.php
public function getRandom($byteLength = 16, $rawBytes = false)
    {
        $randomBytes = random_bytes($byteLength);

        if ($rawBytes) {
            return $randomBytes;
        }

        return bin2hex($randomBytes);
    }
public function getRandom($byteLength = 16, $rawBytes = false)
    {
        $randomBytes = random_bytes($byteLength);

        if ($rawBytes) {
            return $randomBytes;
        }

        return bin2hex($randomBytes);
    }
public function getRandom ( $ byteLength = 16 , $ rawBytes = false ) { $ randomBytes = random_bytes ( $ byteLength ) ; if ( $ rawBytes ) { return $ randomBytes ; } return bin2hex ( $ randomBytes ) ; }
Get a random byte string.

@param int  $byteLength the length of the random string in bytes
@param bool $rawBytes   return the raw random string if true or hex
encoded when false (default)

@return string the random string of specified length
Get a random byte string .