我刚看到这个,我不明白。我不知道一些关于php的内部。。。什么事?或者我是在假设。。。什么事?那不是真的吗?在$ sha512sum
e7c22b994c59d9cf2b48e549b1e24666636045930d3da7c1acb299d1c3b7f931f94aae41edda2c2b207a36e10f8bcb8d45223e54878f5b316e7ce3b6bc019629 /proc/self/fd/11
还有:
^{pr2}$
但随后:php -a
Interactive shell
php > echo hash('sha512', 'hello');
9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043
∅ cat hashtest.php
echo hash('sha512', 'hello');
?>
∅ php hashtest.php
9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043
怎么回事?我在Linuxx86_64上,我的系统文本编码是utf-8,这些都是ascii范围的字符。我不知道我忽略了什么。在
有趣的是,对于一些“有趣”的值,Python同意PHP:>>> hashlib.sha512(b'hello').hexdigest()
'9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043'
老实说,尽管我的开场白并不起眼,但我还是认为这是某种巨大的未知PHP bug。但我想不是。在