Fnv132 Class
Definition
Computes the hash for the input data using the FNV-1 32-bit hash algorithm. This class cannot be inherited.
public sealed class Fnv132 : Fnv, IResumableHashAlgorithm
- Inheritance
-
Fnv132
- 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
The FNV-1 variant performs multiplication before XOR. The 32-bit configuration uses prime 0x01000193 and
offset basis 0x811C9DC5.
Parameters at a glance.
- Output size: 32 bits (4 bytes), big-endian.
- Offset basis:
0x811C9DC5. - FNV prime:
0x01000193. - Variant: FNV-1 (multiply, then XOR).
When to choose Fnv132. Pick Fnv132 only when reproducing a digest from existing FNV-1 32-bit consumers. For new code prefer Fnv1a32: same parameters, better avalanche, identical cost.
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;
using Bodu.IO.Hashing.Extensions;
var fnv = new Fnv132();
byte[] digest = fnv.ComputeHash(System.Text.Encoding.UTF8.GetBytes("key"));
Constructors
Fnv132()
Initializes a new instance of the Fnv132 class using standard FNV-1 32-bit parameters.
public Fnv132()
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |