Adler64 Class
Definition
Computes a 64-bit Adler-style checksum using the prime modulus 4294967291. This class cannot be inherited.
public sealed class Adler64 : Adler64Base, IResumableHashAlgorithm
- Inheritance
-
Adler64
- Implements
- Inherited Members
- Extension Methods
-
NonCryptographicHashAlgorithmExtensions.ComputeHash(NonCryptographicHashAlgorithm, byte[], int, int)NonCryptographicHashAlgorithmExtensions.TryVerifyHash(NonCryptographicHashAlgorithm, byte[], byte[])NonCryptographicHashAlgorithmExtensions.TryVerifyHash(NonCryptographicHashAlgorithm, byte[], string)NonCryptographicHashAlgorithmExtensions.TryVerifyHash(NonCryptographicHashAlgorithm, Stream, byte[])
Remarks
Adler-64 extends the Adler-32 construction into the 64-bit domain. It maintains two 64-bit running sums (A and B)
and combines them as (B << 32) | A. The modulus 4294967291 (the largest prime less than 232
) reduces overflow pressure and improves checksum stability over large inputs compared to Adler-32.
Parameters at a glance.
- Output size: 64 bits (8 bytes).
- Modulus:
4294967291(largest prime < 232). - Compatibility: not a standardized wire format - consumers must agree on Adler-64 explicitly.
When to choose Adler64. Pick Adler64 when 32 bits are not enough - very large datasets where the Adler-32 collision floor becomes a concern, multi-gigabyte block-storage checksums, or high-throughput logging pipelines. For interoperability with deflate / gzip / PNG use Adler32; for stronger error detection at 64 bits prefer Crc with CRC64_XZ.
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 adler = new Adler64();
byte[] checksum = adler.ComputeHash(largePayload);
Constructors
Adler64()
Initializes a new instance of the Adler64 class using the Adler-64 prime modulus (4294967291).
public Adler64()
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |