Checksum¶
A checksum is a small, fixed-size value derived from a longer piece of data, used to detect errors or verify integrity. It is akin to a fingerprint or a signature.
There are several algorithms to create a checksum: crc32, md5, sha1, sha256.
Checksums are extensively used to check file downloads and network transmissions; to verify stored data, identify revisions in vcs and validate components versions with package managers.
<?php
echo md5('PHP rocks!');
echo md5_file('/tmp/text.txt');
?>
See also An introduction to Checksums.
Related : Cyclic Redundancy Check 32-bit (CRC32), Message Digest Algorithm 5 (MD5), Secure Hash Algorithm (SHA), VCS, Fingerprint, Package Manager, Digital Signature