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
<PackageReference Include="Pure.RelationalSchema.HashCodes" Version="3.4.0" />
<PackageVersion Include="Pure.RelationalSchema.HashCodes" Version="3.4.0" />
<PackageReference Include="Pure.RelationalSchema.HashCodes" />
paket add Pure.RelationalSchema.HashCodes --version 3.4.0
#r "nuget: Pure.RelationalSchema.HashCodes, 3.4.0"
#:package Pure.RelationalSchema.HashCodes@3.4.0
#addin nuget:?package=Pure.RelationalSchema.HashCodes&version=3.4.0
#tool nuget:?package=Pure.RelationalSchema.HashCodes&version=3.4.0
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.
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
IDeterminedHashdependencies, 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
Pure.HashCodes— coreIDeterminedHashabstraction andDeterminedHashimplementationPure.RelationalSchema.Abstractions—ISchema,ITable,IColumn,IColumnType,IIndex,IForeignKeyinterfaces
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 | Versions 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. |
-
net10.0
- Pure.HashCodes (>= 2.2.0)
- Pure.RelationalSchema.Abstractions (>= 1.3.0)
-
net11.0
- Pure.HashCodes (>= 2.2.0)
- Pure.RelationalSchema.Abstractions (>= 1.3.0)
-
net7.0
- Pure.HashCodes (>= 2.2.0)
- Pure.RelationalSchema.Abstractions (>= 1.3.0)
-
net8.0
- Pure.HashCodes (>= 2.2.0)
- Pure.RelationalSchema.Abstractions (>= 1.3.0)
-
net9.0
- Pure.HashCodes (>= 2.2.0)
- Pure.RelationalSchema.Abstractions (>= 1.3.0)
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.