CRC32Fingerprint()
Syntax
Result = CRC32Fingerprint(*Buffer, Size [, InitialValue])Description
Perform a CRC32 checksum on the given buffer. CRC32 is a 32 bit fingerprint not intended for password storage as it's easily crackable, but for quick data integrity check. For example, zip files have a CRC32 checksum at the end of each file to be sure that the zip is not corrupted. The main advantage of CRC32 over MD5 or other hash algoritm is its very high speed.
The optional InitialValue parameter can be used to pass the checksum of a previous buffer. The result will then be the checksum of both buffers, as if it were calculated from one continuous buffer. This way calculating the checksum of large data can be broken down into a number of calculations on smaller buffers.
Example:
*Buffer = AllocateMemory(200) ; Prepare a buffer with data If *Buffer PokeS(*Buffer, "The quick brown fox jumps over the lazy dog.") Length = MemoryStringLength(*Buffer) CRC32 = CRC32Fingerprint(*Buffer, Length) ; Calculate the checksum in 1 step Debug "CRC32 checksum = " + Str(CRC32) Part1 = CRC32Fingerprint(*Buffer, Length/2) ; Calculate the checksum in 2 steps CRC32 = CRC32Fingerprint(*Buffer+Length/2, Length/2, Part1) Debug "CRC32 checksum = " + Str(CRC32) FreeMemory(*Buffer) EndIf
Supported OS
All