Deterministic hash code implementations for chart model abstractions in the Pure ecosystem.
Pure.Chart.Model.HashCodes provides deterministic, byte-enumerable hash codes for every type in the chart model abstraction layer. Each type wraps one of the Pure.Chart.Model.Abstractions interfaces and produces a stable byte sequence by prepending a fixed 16-byte type-discriminator prefix before hashing the object's fields. The resulting sequences compose cleanly with Pure.HashCodes.DeterminedHash, enabling structural equality checks and content-addressed storage across chart configurations.
All types are sealed record and implement IDeterminedHash (which extends IEnumerable<byte>).
| Type | Wraps | Hashed fields |
|---|---|---|
ChartHash | IChart | Title, Description, Type, XAxis, YAxis, Series |
ChartTypeHash | IChartType | Name |
ChartSeriesHash | IChartSeries | Legend, XAxisSource, YAxisSource |
AxisHash | IAxis | Legend |
All hash types live in the Pure.Chart.Model.HashCodes namespace.
Pure.Chart.Model.Abstractions— chart domain interfaces (IChart,IChartType,IChartSeries,IAxis)Pure.HashCodes— deterministic, byte-enumerable hash computation over Pure primitives
- .NET 7
- .NET 8
- .NET 9
- .NET 10
dotnet add package Pure.Chart.Model.HashCodes
usingPure.Chart.Model.HashCodes;IChartchart= ...;// any IChart implementation// Enumerate the hash bytes directlybyte[]hash=newChartHash(chart).ToArray();// Compose with other IDeterminedHash valuesIEnumerable<byte>combined=newDeterminedHash(newChartHash(chartA).Concat(newChartHash(chartB)));