crc32 – PHP String Functions

Syntax :

string crc32(string);

Description :

crc32() function will return CRC32 i.e cyclic redundancy checksum polynomial of 32-bit lengths of the string. This is usually used to validate the integrity of data being transmitted.

Note : You need to use the “%u” formatter of sprintf() or printf() to get the string representation of the unsigned crc32() checksum in decimal format.

Parameter :

string –  String to be used.


Output :

This will return CRC32 i.e cyclic redundancy checksum polynomial of 32-bit lengths of the string.


PHP crc32() function Example 1

<?php
$checksum = crc32("Hi from tutorialmines.net!");
 printf("%u", $checksum);
?>

In above example ,We have a string “Hi from tutorialmines.net!”. So, when we apply crc32() function.

Now Output will become –

1895815105

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *