CRC32 (Cyclic Redundency Check)

One of the most effective method to check if the file is ok is to calculate CRC32 checksum and compare it with previously saved value. Using CRC check, you can also compare two files, verify downloaded files etc…
Even if the source code is rather long, the function itself is short and not complicated. It reads file “byte by byte” and calculate checksum using some formula. It is not really necessary to understand this algorithm, don’t bother yourself with “magic” numbers in array. Just use code as it is.