How to use it
- Type or paste the input. Text is read as UTF-8, so letters outside ASCII count as several bytes.
- Switch to “Hex bytes” to check raw data, for example
78 9cor0x01,0x02; spaces, commas and 0x are ignored. - Copy the hex value. The decimal number next to it is the same checksum.
How it works
- Adler-32: A = 1 + sum of bytes, B = sum of the successive values of A, both mod 65521; result B·65536 + A.
- Fletcher-16: sum1 = sum of bytes, sum2 = sum of the successive sum1, both mod 255; result sum2·256 + sum1.
- Fletcher-32: the same over 16-bit little-endian words, mod 65535; result sum2·65536 + sum1.
Example
The word Wikipedia (9 bytes):
- Adler-32: the bytes add up to 919, so A = 1 + 919 = 920 = 0x0398; B = 4582 = 0x11E6. Result
11E60398, decimal 300286872. - Fletcher-16:
EE9A. - Fletcher-32:
B7DDA1F8.
The test string abcde gives Fletcher-16 C8F0 and Fletcher-32 F04FC729.
Tips
- Compare with Python:
zlib.adler32(b"Wikipedia")returns 300286872. - The Adler-32 of empty input is
00000001, because A starts at 1. - For short messages Adler-32 is weak: A and B do not wrap, so many bit patterns are left unused. CRC-32 detects errors better.