crc32

Calculates the crc32 polynomial of a string

Syntax

crc32 ( string $str ) : int

Parameters

str

The data.

Return

Returns the crc32 checksum of str as an integer.

Warning: Because PHP's integer type is signed many crc32 checksums will result in negative integers on 32bit platforms. On 64bit installations all crc32() results will be positive integers. Use the "%u" formatter of sprintf() or printf() to get the string representation of the unsigned crc32() checksum in decimal format.

Examples

<?

$str = "The brown-and-white dog jumped over the other brown-and-white dog.";

$return = crc32($str);
printf("%u", $return);

?>
3872971914

PHP

Home Menu