budul.HashExtensions 2.0.0

dotnet add package budul.HashExtensions --version 2.0.0
                    
NuGet\Install-Package budul.HashExtensions -Version 2.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="budul.HashExtensions" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="budul.HashExtensions" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="budul.HashExtensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add budul.HashExtensions --version 2.0.0
                    
#r "nuget: budul.HashExtensions, 2.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.
#:package budul.HashExtensions@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=budul.HashExtensions&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=budul.HashExtensions&version=2.0.0
                    
Install as a Cake Tool

HashExtensions

License NuGet

HashExtensions is a C# library providing advanced, flexible, and efficient hashing utilities for sequences, collections, and strings. It is designed for .NET Standard 2.1 and .NET 6/7/8, making it compatible with a wide range of modern .NET applications.

Features

  • Sequence Hashing: Compute hashes for sequences, collections, or arrays, with support for:
    • Order-sensitive, order-insensitive, and direction-insensitive hashing
    • Hashing based on specific properties or multiple properties
  • Static Hash Generation: Generate fixed-length numeric or alphanumeric hashes from strings or collections of strings
  • Customizable Hash Length: Control the length of generated hashes (1�12 digits/characters)
  • Optimized Performance: Uses precomputed values and efficient algorithms for fast hash calculation

Installation

Add the source file to your project or build as a class library and reference it.

Usage

Sequence Hashing

using HashExtensions;

// Hash a sequence of objects 
int hash = Extensions.GetSequenceHash(item1, item2, item3);

// Hash a collection with a property selector 
int hash = myList.GetSequenceHash(x => x.Id);

// Order-insensitive hash 
int hash = myList.GetSequenceHashOrdered();

// Direction-insensitive hash 
int hash = myList.GetSequenceHashDirected();

Static Hash Generation

using HashExtensions;

// Numeric hash from strings 
ulong numHash = Extensions.GetStaticHashNumber("foo", "bar");

// Alphanumeric hash from strings 
string textHash = Extensions.GetStaticHashText("foo", "bar");

// Control hash length (1�12) 
ulong shortHash = "example".GetStaticHashNumber(length: 6); 
string shortTextHash = "example".GetStaticHashText(length: 8);

API Reference

See HashExtensions/Extensions.cs for full documentation and XML comments.

Target Frameworks

  • .NET Standard 2.1
  • .NET 6
  • .NET 7
  • .NET 8

License

See LICENSE for details.

Contributing

Contributions, issues, and feature requests are welcome!

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on budul.HashExtensions:

Package Downloads
budul.EnumerableExtensions

Multiple extension methods to determine, manipulate and adjust enumerable data

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 58 8/23/2025
1.8.0 671 10/30/2020
1.7.0 501 10/16/2020
1.6.0 5,101 10/11/2020
1.5.0 500 9/30/2020
1.4.0 531 9/23/2020
1.3.0 490 8/7/2020
1.2.0 511 7/29/2020
1.1.0 599 6/24/2020
1.0.0 1,933 5/5/2020