Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
564 views
Welcome To Ask or Share your Answers For Others

1 Answer

Two different algorithms. CRC32b is an implementation of the consistency algorithm defined here, whereas CRC32 is the frame check sequence defined here. They're different things, though the differences are not often big.

One way to check this:

<?php
echo hash("crc32", __FILE__)."<br/>";
echo hash("crc32b", __FILE__); ?>

Due to their similarity, the starting hex values will be relatively similar.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...