Quote:
Originally Posted by Wikipedia
A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data.
|
CRC-32 is very fast, even on larger files, and it's designed to handle unintentional changes in data. Useful in cases such as verifying the integrity of a downloaded file.
It should not be used for security purposes.
PHP Code:
/**
* Produces a CRC-32 checksum for a given data stream.
*
* @param data Input data to calculate the checksum from.
* @param size Total size of data in bytes.
* @return CRC-32 checksum as an integer.
*/
stock CRC32_Data(const String:data[], size)
/**
* Produces a CRC-32 checksum for a given file.
*
* @param path Path to the file.
* @return CRC-32 checksum as an integer.
* @error Failed to open file or file does not exist.
*/
stock CRC32_File(const String:path[])