Table of Contents

FowlerNollVo64 Class

Definition

Namespace
Cuemon.Security
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/Security/FowlerNollVo64.cs

Provides an implementation of the FVN (Fowler–Noll–Vo) non-cryptographic hashing algorithm for 64-bit hash values. This class cannot be inherited. Implements the FowlerNollVoHash

public sealed class FowlerNollVo64 : FowlerNollVoHash, IHash, IConfigurable<FowlerNollVoOptions>
Inheritance
FowlerNollVo64
Implements
Inherited Members

Examples

The following example demonstrates how to compute a 64-bit Fowler-Noll-Vo (FNV) hash using the FowlerNollVo64 class.

// Program.cs
using System;
using System.Text;
using Cuemon.Security;
using Cuemon;

// Create FNV-1a 64-bit hash instance (default algorithm)
var fnv = new FowlerNollVo64();

// Compute hash from a string
byte[] data = Encoding.UTF8.GetBytes("hello");
HashResult hash = fnv.ComputeHash(data);

// Display the hash in hexadecimal format
Console.WriteLine(hash.ToHexadecimalString());

// Switch to FNV-1 algorithm
fnv.Options.Algorithm = FowlerNollVoAlgorithm.Fnv1;
HashResult hashFnv1 = fnv.ComputeHash(data);
Console.WriteLine(hashFnv1.ToHexadecimalString());

// Change byte order to little endian
fnv.Options.ByteOrder = Endianness.LittleEndian;
HashResult hashLe = fnv.ComputeHash(data);
Console.WriteLine(hashLe.ToHexadecimalString());

Constructors

Name Description
FowlerNollVo64(Action<FowlerNollVoOptions>)

Initializes a new instance of the FowlerNollVo64 class.

See Also