[英]Equivalent build-in functions not outputs same values
眾所周知,PHP提供了許多內置函數,它們可以做同樣的事情......這可能更多,但很奇怪,
echo "\nhash = ".hash('crc32', 'My Test');
// as guide say "outputs lowercase hexits", hash = c6fd93c1
echo "\nhash from raw = ".bin2hex( hash('crc32','My Test',true) );
// confirm that "hexits" are hexadecimals, = c6fd93c1
echo "\ncrc32 = ".base_convert( crc32('My Test') , 10, 16);
// crc32 = c55b6e4 !! not the same
有多個“標准CRC32”? 為什么不顯示相同的值?
crc32
函數計算與crc32b
相同的哈希hash
。
$ php -r 'echo hash("crc32b", "My Test");' ;echo
0c55b6e4
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.