What is the difference between crc32 and crc32b?

前端 未结 3 407
渐次进展
渐次进展 2020-12-06 01:12

Apparently the PHP function hash() can be called with the algorithms crc32 and crc32b? What is the difference between them?

3条回答
  •  时光说笑
    2020-12-06 01:29

    As per answer by apm on php.net: "I have verified that the output of the "crc32" is the ITU I.363.5 algorithm (a.k.a. AAL5 CRC - popularised by BZIP2 but also used in ATM transmissions - the algorithm is the same as that in POSIX 1003.2-1992 in Cksum but that stuffs the size into the CRC at the end for extra measure). -- The crc32b is the 32-bit Frame Check Sequence of ITU V.42 (used in Ethernet and popularised by PKZip). The output from this CRC is popularised in Intel little endian format and would produce cbf43926 on the same file."

    The full comment: http://www.php.net/manual/en/function.hash-file.php#104836

提交回复
热议问题