Base interface for the Pure hash code ecosystem — a minimal, byte-enumerable contract for deterministic hash sequences.
Pure.HashCodes.Abstractions defines a single interface — IDeterminedHash — that every deterministic hash type in the Pure ecosystem implements. The interface extends IEnumerable<byte>, exposing the underlying hash as an ordered byte sequence. This allows hash values from different domain types to be combined, compared, and composed without coupling to any concrete hash algorithm.
namespace Pure.HashCodes.Abstractions;
public interface IDeterminedHash : IEnumerable<byte>;IDeterminedHash carries no methods beyond IEnumerable<byte>. Concrete implementations (in Pure.HashCodes and domain-specific packages) are responsible for producing stable byte sequences. Calling GetHashCode() or ToString() on any IDeterminedHash implementation throws NotSupportedException by design — byte enumeration is the only supported equality mechanism.
- Single responsibility — one interface, one concept: a deterministic byte sequence.
- Composable — byte sequences from multiple
IDeterminedHashvalues concatenate cleanly to form compound hashes. - AOT-compatible — no reflection, no generics constraints beyond
IEnumerable<byte>.