Class FowlerNollVo1024
Provides an implementation of the FVN (Fowler–Noll–Vo) non-cryptographic hashing algorithm for 1024-bit hash values. This class cannot be inherited. Implements the FowlerNollVoHash
public sealed class FowlerNollVo1024 : FowlerNollVoHash, IHash, IConfigurable<FowlerNollVoOptions>
- Inheritance
-
FowlerNollVo1024
- Implements
- Inherited Members
Examples
The following example shows how to compute 1024-bit Fowler-Noll-Vo hashes for the same payload with different algorithms.
using System;
using System.Text;
using Cuemon;
using Cuemon.Security;
namespace MyApp.Examples;
public static class FowlerNollVo1024Example
{
public static void Demonstrate()
{
var hasher = new FowlerNollVo1024(options =>
{
options.Algorithm = FowlerNollVoAlgorithm.Fnv1a;
options.ByteOrder = Endianness.BigEndian;
});
HashResult orderHash = hasher.ComputeHash(Encoding.UTF8.GetBytes("order-42"));
Console.WriteLine(hasher.Bits);
Console.WriteLine(orderHash.GetBytes().Length);
Console.WriteLine(orderHash.ToHexadecimalString());
var legacyHasher = new FowlerNollVo1024(options => options.Algorithm = FowlerNollVoAlgorithm.Fnv1);
Console.WriteLine(legacyHasher.ComputeHash("order-42").ToHexadecimalString());
}
}
Constructors
FowlerNollVo1024(Action<FowlerNollVoOptions>)
Initializes a new instance of the FowlerNollVo1024 class.
public FowlerNollVo1024(Action<FowlerNollVoOptions> setup = null)
Parameters
setupAction<FowlerNollVoOptions>The FowlerNollVoOptions which may be configured.