Table of Contents

Fletcher64 Class

Definition

Namespace
Bodu.IO.Hashing.Checksums
Assembly
Bodu.IO.Hashing.dll
Package
Bodu.IO.Hashing 1.0.0
Source
Fletcher.64.cs

Computes the hash for the input data using the Fletcher-64 hash algorithm. This variant performs a non-cryptographic checksum calculation using two 32-bit accumulators to efficiently detect errors in byte sequences. This class cannot be inherited.

public sealed class Fletcher64 : Fletcher, IResumableHashAlgorithm
Inheritance
Fletcher64
Implements
Inherited Members
Extension Methods

Remarks

Fletcher64 is a non-cryptographic hash algorithm that computes a 64-bit checksum by iteratively processing input bytes using two 32-bit rolling sums. It was introduced by Brian Kernighan and Dennis Ritchie and is commonly used in applications such as network protocols, data validation, and embedded systems where simple and efficient error detection is sufficient.

Parameters at a glance.

  • Output size: 64 bits (8 bytes).
  • Accumulator width: two 32-bit rolling sums (A and B).
  • Modulus: 4294967295.

When to choose Fletcher64. Pick Fletcher64 for very large datasets where the 32-bit collision floor becomes a concern - multi-gigabyte file integrity, large block-storage checksums, or high-throughput logging pipelines. For stronger error detection at comparable width prefer Crc with CRC64_XZ or CRC64_ECMA182.

important

This algorithm is not cryptographically secure and should not be used for password hashing, digital signatures, or integrity validation in security-sensitive applications.

using Bodu.IO.Hashing.Checksums;
using Bodu.IO.Hashing.Extensions;

var f64 = new Fletcher64();
byte[] checksum = f64.ComputeHash(largePayload);

Constructors

Fletcher64()

Initializes a new instance of the Fletcher64 class with a 64-bit hash size.

public Fletcher64()

Methods

CreateEmpty()

Creates a new, empty instance of the concrete Fletcher variant. Replaces the former new TSelf() CRTP construction as the factory the base Clone() uses to snapshot running state.

protected override Fletcher CreateEmpty()

Returns

Fletcher

A fresh instance of the derived variant with default accumulator state.

Applies to

ProductVersions
.NET8, 10

See Also