我正在打电话
echo bintohex(random_bytes(30));
但我的日志显示
PHP Fatal error: Call to undefined function bintohex()
PHP 5.6.17
Apache 2.2.15
CentOS 6.7
Mcrypt 2.5.8 (在phpinfo()页面安装并validation)
extension = mcrypt.so (现在)
任何想法,为什么我找不到bintohex()或random_bytes()函数?
因为它bin2hex http://php.net/manual/en/function.bin2hex.php不是“bintohex”
random_bytes基本上只存在于PHP 7根据文档http://php.net/random_bytes,但这里是polyfill到5.x版本https://github.com/paragonie/random_compat