Pure.RelationalSchema.HashCodes 3.4.0

dotnet add package Pure.RelationalSchema.HashCodes --version 3.4.0
                    
NuGet\Install-Package Pure.RelationalSchema.HashCodes -Version 3.4.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="Pure.RelationalSchema.HashCodes" Version="3.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pure.RelationalSchema.HashCodes" Version="3.4.0" />
                    
Directory.Packages.props
<PackageReference Include="Pure.RelationalSchema.HashCodes" />
                    
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 Pure.RelationalSchema.HashCodes --version 3.4.0
                    
#r "nuget: Pure.RelationalSchema.HashCodes, 3.4.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 Pure.RelationalSchema.HashCodes@3.4.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=Pure.RelationalSchema.HashCodes&version=3.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Pure.RelationalSchema.HashCodes&version=3.4.0
                    
Install as a Cake Tool

Pure.RelationalSchema.HashCodes

Deterministic hash implementations for relational schema components in the Pure ecosystem — schemas, tables, columns, indexes, and foreign keys as composable IDeterminedHash byte sequences.

.NET build & test Build and Deploy NuGet License: MIT

Overview

Pure.RelationalSchema.HashCodes provides deterministic, SHA-256-based hash records for every component in a relational schema. Each type accepts either raw domain objects (from Pure.RelationalSchema.Abstractions) or pre-computed IDeterminedHash values, enabling incremental hashing and efficient reuse of previously computed sub-hashes.

Hash Types

Type Inputs hashed
SchemaHash name, tables collection, foreign keys collection
TableHash name, columns collection, indexes collection
ColumnHash name, column type
ColumnTypeHash column type name
IndexHash uniqueness flag, columns collection
ForeignKeyHash referencing table, referencing columns, referenced table, referenced columns

Every type is a sealed record implementing IDeterminedHash and IEnumerable<byte> — the underlying bytes of its SHA-256 digest. Calling GetHashCode() or ToString() throws NotSupportedException by design; use byte enumeration for equality checks.

Each type embeds a unique 16-byte domain-separation prefix before hashing, so hashes of structurally identical values from different types are never equal.

Collections (tables, columns, indexes, foreign keys) are hashed in an order-independent manner — reversing a collection produces the same hash.

Design Principles

  • Deterministic — identical schema structures always produce the same byte sequence.
  • Composable — every constructor accepts either raw domain objects or pre-computed IDeterminedHash dependencies, so callers decide what to recompute vs. reuse.
  • Domain-separated — each type prefixes a fixed 16-byte token before SHA-256, preventing cross-type collisions.

Dependencies

Target Frameworks

  • .NET 7
  • .NET 8
  • .NET 9
  • .NET 10
  • .NET 11

Installation

dotnet add package Pure.RelationalSchema.HashCodes

Usage

ISchema schema = /* ... */;

// Hash a full schema
byte[] hash = new SchemaHash(schema).ToArray();

// Reuse a pre-computed sub-hash
IDeterminedHash tableHash = new TableHash(table);
SchemaHash schemaHash = new SchemaHash(schemaName, tableHash, foreignKeyHash);

// Compare two schemas structurally
bool equal = new SchemaHash(schemaA).SequenceEqual(new SchemaHash(schemaB));
Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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 is compatible.  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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (13)

Showing the top 5 NuGet packages that depend on Pure.RelationalSchema.HashCodes:

Package Downloads
Pure.RelationalSchema.Storage.HashCodes

Package Description

Pure.RelationalSchema.Self.Storage.Projection

Package Description

Pure.RelationalSchema.Storage.PureQL.Projection

Package Description

Pure.RelationalSchema.Storage.PostgreSQL.Querying

Package Description

PureQL.CSharp.Model.Samples

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.4.0 326 11/11/2026
3.3.0 5,695 3/16/2026
3.2.0 2,281 12/6/2025
3.1.0 1,128 11/5/2025
3.0.0 1,236 11/4/2025
2.0.0 1,052 9/26/2025
2.0.0-preview.0.1.0 167 9/26/2025
1.0.0 916 8/25/2025
0.2.0 498 8/21/2025
0.1.0 404 6/25/2025