Table of Contents

Class FowlerNollVoOptions

Namespace
Cuemon.Security
Assembly
Cuemon.Core.dll

Configuration options for FowlerNollVoHash.

public class FowlerNollVoOptions : ConvertibleOptions, IParameterObject
Inheritance
FowlerNollVoOptions
Implements
Inherited Members

Examples

The following example demonstrates how to configure FowlerNollVoOptions with a specific algorithm and byte order, then use FowlerNollVo32 to compute a hash.

using System.Text;
using System;
using Cuemon.Security;

using Cuemon;
namespace MyApp.Examples;

public class FowlerNollVoOptionsExample
{
    public static void Main()
    {
        // Create a FowlerNollVoOptions instance to configure the hash algorithm
        var fnvOptions = new FowlerNollVoOptions();
        fnvOptions.Algorithm = FowlerNollVoAlgorithm.Fnv1a;
        fnvOptions.ByteOrder = Endianness.LittleEndian;

        // Apply configuration through the setup delegate
        var fnv32 = new FowlerNollVo32(o =>
        {
            o.Algorithm = fnvOptions.Algorithm;
            o.ByteOrder = fnvOptions.ByteOrder;
        });

        byte[] data = Encoding.UTF8.GetBytes("Hello, World!");
        HashResult hash = fnv32.ComputeHash(data);

        Console.WriteLine("FNV-1a 32-bit (little-endian): {0}", hash.ToHexadecimalString());

        // Output:
        // FNV-1a 32-bit (little-endian): 7b56c21a

}
}

Constructors

FowlerNollVoOptions()

Initializes a new instance of the FowlerNollVoOptions class.

public FowlerNollVoOptions()

Remarks

The following table shows the initial property values for an instance of FowlerNollVoOptions.

PropertyInitial Value
ByteOrderBigEndian
AlgorithmFnv1a

Properties

Algorithm

Gets or sets the algorithm of the Fowler-Noll-Vo hash function.

public FowlerNollVoAlgorithm Algorithm { get; set; }

Property Value

FowlerNollVoAlgorithm

The algorithm of the Fowler-Noll-Vo hash function.