I have a MD5 hash: 10f86782177490f2ac970b8dc4c51014
but PHP: crc32('10f86782177490f2ac970b8dc4c51014'); Result: -951183655
I don't understand!
It's only a matter of representation of the data :
And here's a portion of code to illustrate that :
$crc = crc32('10f86782177490f2ac970b8dc4c51014'); var_dump($crc); var_dump(dechex($crc));
It'll display :
int -951183655 string 'c74e16d9' (length=8)
Which corresponds to :
- The decimal representation of the value of your CRC
- and, after that, the hexadecimal represenation of that same value.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki