PHP crc32() function

The crc32() function calculates the crc32 polynomial of a string (crc32 checksum return as an integer)

Syntax

crc32 ( string $string ) : int

Parameters

Parameter Name Descrption
$string Required, The string data.

Return Value

Returns the crc32 checksum of given data as an integer

crc32() examples

$checksum = crc32("The String Test");
printf("%u\n", $checksum);
//Output :1054885480

Related Functions

  • sha1(): Calculate the sha1 hash of a string
  • sha1_file(): Calculate the sha1 hash of a file
  • crypt(): One-way string hashing
  • md5(): Calculate the md5 hash of a string
  • md5_file(): Calculates the md5 hash of a given file