bintohex() 和 random_bytes() 函数在 PHP 5.6 on Linux 中未定义

bintohex() and random_bytes() functions are undefined in PHP 5.6 on Linux

我正在尝试打电话给

echo bintohex(random_bytes(30));

但是我的日志显示

PHP Fatal error:  Call to undefined function bintohex()

PHP 5.6.17
阿帕奇 2.2.15
CentOS 6.7
Mcrypt 2.5.8 (已在 phpinfo() 页面上安装和验证)
extension=mcrypt.so (现在)

我找不到 bintohex() 或 random_bytes() 函数的任何想法?

因为它 bin2hex http://php.net/manual/en/function.bin2hex.php 而不是 "bintohex"

random_bytes 根据文档 http://php.net/random_bytes but here is polyfill to 5.x version https://github.com/paragonie/random_compat

基本上只存在于 Php 7