Fletcher checksums
Position-dependent sum checksums from 1982, cheaper than CRCs in software
Overview
The Fletcher checksum is an error-detecting checksum devised by John G. Fletcher at Lawrence Livermore Laboratory and published in 1982. It improves on a simple sum by also summing the running totals, so it detects reordered data. It provides no security against a deliberate attacker.
Fletcher-16 processes 8-bit words and keeps two sums modulo 255; Fletcher-32 processes 16-bit words with sums modulo 65535. The first sum accumulates data words; the second accumulates the first sum, which makes the checksum sensitive to position. The result concatenates the two sums. It is cheaper to compute than a CRC.
NextSSL includes Fletcher-16 and Fletcher-32. The checksum is used in some network protocols and file systems, and Adler-32 is a variant with a prime modulus. Fletcher-64 also exists. None of this provides security: the function has no secret key, and anyone can compute or deliberately collide its outputs. It has no key.
History
1982–1982Fletcher checksums published by John G. Fletcher
Security notes
Fletcher checksums are not cryptographic and can be forged trivially. Because of the ones-complement modulus they cannot distinguish all-zero from all-ones words, and their error detection is weaker than a CRC of the same width.
Typical uses
Variants in NextSSL
2| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| Fletcher16 fletcher16 |
standard | out 2 | Fletcher 1982 | safe |
| Fletcher32 fletcher32 |
standard | out 4 | Fletcher 1982 | safe |
Frequently asked questions
Which Fletcher checksums variants does NextSSL include?
NextSSL registers 2 Fletcher checksums variants: fletcher16, fletcher32.