CRC-32 hash tutorial

Put simple Tips and Tricks that are not entire Tutorials in this forum
jeeswg
Posts: 4575
Joined: 19 Dec 2016, 01:58
Location: UK

CRC-32 hash tutorial

The mathematics of CRC-32:

==================================================

Some scripts/functions for 'CRC division' and calculating CRC-32 hashes:

==================================================

crc_v3.txt
get CRC-32 hash value, read file in chunks - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=31329
CRC-32 - Rosetta Code
https://rosettacode.org/wiki/CRC-32#AutoHotkey
CRC32 algorithm/implementation in C without a look up table and with a public license - Stack Overflow
https://stackoverflow.com/questions/21001659/crc32-algorithm-implementation-in-c-without-a-look-up-table-and-with-a-public-li
crc.c.txt
http://www.hackersdelight.org/hdcodetxt/crc.c.txt
How to calculate CRC32 by hand? – An Integrated World
https://www.anintegratedworld.com/how-to-calculate-crc32-by-hand/

==================================================

[example calculations]
crc_v3.txt
Sunshine's Homepage - Understanding CRC
http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html
How to calculate CRC32 by hand? – An Integrated World
https://www.anintegratedworld.com/how-to-calculate-crc32-by-hand/

[dll function]
Wine API: RtlComputeCrc32
https://source.winehq.org/WineAPI/RtlComputeCrc32.html

[algorithms / AutoHotkey code]
get CRC-32 hash value, read file in chunks - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=31329
CRC-32 - Rosetta Code
https://rosettacode.org/wiki/CRC-32#AutoHotkey
AHK_Scripts/CRC32.ahk at master · jNizM/AHK_Scripts · GitHub
https://github.com/jNizM/AHK_Scripts/blob/master/src/hash_checksum/CRC32.ahk#L2
CRC32 algorithm/implementation in C without a look up table and with a public license - Stack Overflow
https://stackoverflow.com/questions/21001659/crc32-algorithm-implementation-in-c-without-a-look-up-table-and-with-a-public-li
crc.c.txt
http://www.hackersdelight.org/hdcodetxt/crc.c.txt
[pdf appendix contains algorithms]
SAR-PR-2006-05.pdf
http://stigge.org/martin/pub/SAR-PR-2006-05.pdf
Calculating 32-bit CRCs (CRC-32)
http://mdfs.net/Info/Comp/Comms/CRC32.htm

[online solver]
On-line CRC calculation and free library
https://www.lammertbies.nl/comm/info/crc-calculation.html

[other hashes: information about other hashing algorithms e.g. MD5 and SHA-1]
MD5 - Scripts and Functions - AutoHotkey Community
https://autohotkey.com/board/topic/16409-md5/
SHA: Secure Hashing Algorithm - Computerphile - YouTube
EXTRA BITS - SHA1 Problems - Computerphile - YouTube
Hashing Algorithms and Security - Computerphile - YouTube

[Stack Exchange discussions]
c - How is a CRC32 checksum calculated? - Stack Overflow
https://stackoverflow.com/questions/2587766/how-is-a-crc32-checksum-calculated
algorithm design - How do I calculate CRC32 mathematically? - Cryptography Stack Exchange
https://crypto.stackexchange.com/questions/3367/how-do-i-calculate-crc32-mathematically
c# - Is there a built-in function to reverse bit order - Stack Overflow
https://stackoverflow.com/questions/3587826/is-there-a-built-in-function-to-reverse-bit-order

==================================================

SOME OTHER 'HOW DOES IT WORK?' QUESTIONS:

How does a PC work?
Charles Petzold - Code

How do txt files work?
ANSI: 1 byte per character (0-255).
UTF-8: 1 byte per character (0-127, ASCII). 2 bytes per character (128-2047). 3 bytes per character (4096-65535).
UTF-16: 2 bytes per character (0-65535).
Note: where ANSI 128-255 ('extended ASCII') is often similar to, but not exactly the same as, Unicode 128-255, and where ANSI 128-255 varies depending on the codepage.

How do bmp files work?
graphics: create bmp files from scratch - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=34952

How do wav files work?
create wav files from scratch (draw a wav file) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=34584

How do file hashes work?
CRC-32 hash tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=35671