FingerprintBuilder 1.0.0

.NET Standard 2.0
Additional Details

The code uses BinaryFomatter -  https://aka.ms/binaryformatter

dotnet add package FingerprintBuilder --version 1.0.0
NuGet\Install-Package FingerprintBuilder -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FingerprintBuilder" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FingerprintBuilder --version 1.0.0
#r "nuget: FingerprintBuilder, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FingerprintBuilder as a Cake Addin
#addin nuget:?package=FingerprintBuilder&version=1.0.0

// Install FingerprintBuilder as a Cake Tool
#tool nuget:?package=FingerprintBuilder&version=1.0.0

fingerprint-builder-net

ci nuget nuget codecov license

Installation

 dotnet add package FingerprintBuilder

Use

Declare class:

class UserInfo
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
}

Configure Func:

var fingerprint = FingerprintBuilder<UserInfo>
    .Create(SHA256.Create().ComputeHash)
    .For(p => p.FirstName)
    .For(p => p.LastName)
    .Build();

Get hash:

var user = new UserInfo { FirstName = "John", LastName = "Smith" };
var hash = fingerprint(user).ToLowerHexString(); // 9996c4bbc1da4938144886b27b7c680e75932b5a56d911754d75ae4e0a9b4f1a

Benchmarks

BenchmarkDotNet=v0.12.1, OS=arch
Intel Core i7-8565U CPU 1.80GHz (Whiskey Lake), 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=3.1.300
  [Host]     : .NET Core 3.1.4 (CoreCLR 4.700.20.20201, CoreFX 4.700.20.22101), X64 RyuJIT
  Job-PCQRMO : .NET Core 3.1.4 (CoreCLR 4.700.20.20201, CoreFX 4.700.20.22101), X64 RyuJIT

Runtime=.NET Core 3.1  IterationCount=50  LaunchCount=2
RunStrategy=Throughput  WarmupCount=10
Method Mean Error StdDev Min Max Median
MD5_Model_To_Hex 4.277 μs 0.0763 μs 0.2128 μs 4.007 μs 4.612 μs 4.275 μs
SHA1_Model_To_Hex 4.303 μs 0.0232 μs 0.0639 μs 4.178 μs 4.475 μs 4.300 μs
SHA256_Model_To_Hex 5.183 μs 0.0526 μs 0.1500 μs 4.987 μs 5.627 μs 5.151 μs
SHA512_Model_To_Hex 6.842 μs 0.0688 μs 0.1908 μs 6.626 μs 7.470 μs 6.795 μs

License

All contents of this package are licensed under the MIT license.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 35,229 8/28/2021
0.5.0 132,902 5/13/2020
0.4.0 3,360 12/18/2019
0.3.0 832 12/16/2019
0.2.0 602 11/30/2019