SystemEX  Lacking
Additional generic collection types missing in .net
SystemEx.Hash.IHashable< T > Interface Template Reference

Defines a contract for objects that can be converted into a raw byte representation suitable for hashing, serialization, or low‑level processing. More...

Inheritance diagram for SystemEx.Hash.IHashable< T >:

Public Member Functions

FixedVector< byte > ToBytes ()
 Converts this instance into a deterministic byte array. The returned data is used as input for hashing algorithms.

Detailed Description

Defines a contract for objects that can be converted into a raw byte representation suitable for hashing, serialization, or low‑level processing.

The interface is intentionally minimal: any type implementing IHashable<T> must provide a deterministic and stable ToBytes method. The returned byte sequence is used by SystemEx hashing algorithms and must remain consistent across platforms and runtime sessions.

Example:
A type implementing both IHashable<T> and a hash attribute:

[HashAlgorithm(typeof(Bernstein))]
public class Foo : IHashable&lt;Foo&gt;
{
public FixedVector&lt;byte&gt; ToBytes()
{
// Convert internal fields into a deterministic byte array.
return new FixedVector&lt;byte&gt;( ... );
}
}
FixedVector< byte > ToBytes()
Converts this instance into a deterministic byte array. The returned data is used as input for hashin...
Template Parameters
TThe type that provides its own byte representation.

Member Function Documentation

◆ ToBytes()

FixedVector< byte > SystemEx.Hash.IHashable< T >.ToBytes ( )

The documentation for this interface was generated from the following file:
  • HashFactory.cs