Hash Lab

Checksum

Fletcher’s checksum

Proposed by John G. Fletcher (Lawrence Livermore, 1982). Two running sums (one of the data, one of the first sum’s history) combined into a single output. Catches all single-bit, all double-bit, and all burst errors of short length , while running far faster than CRC. Widely deployed in network protocols where speed matters.

The three sizes

VariantOutputModulus
Fletcher-1616 bits255
Fletcher-3232 bits65535
Fletcher-6464 bits4294967295

How it works

Maintain two accumulators a, b initialized to 0 (or to a non-zero starting state per the variant). For each input word w: a = (a + w) mod M; b = (b + a) mod M. Output (b << bits) | a where bits is half the output width. Compared with Adler-32, the modulus is the Mersenne-like 2k−1 rather than a prime , making the modular reduction cheaper at the cost of slightly weaker distribution.

Where it shows up

Limitations

Like every checksum on this list, Fletcher is non-cryptographic. Adversaries can construct collisions trivially. It also has a well-known limitation: a block of all-zero bytes followed by a single non-zero byte at the right position can mask error patterns.

References

Test Your Knowledge

Quick MCQ check on this algorithm

Start Quiz →

AI Summary

Summarize this page in your favorite LLM