SystemEX  Lacking
Additional generic collection types missing in .net
SystemEx.Hash.RamakrishnaHash Class Referencesealed
Inheritance diagram for SystemEx.Hash.RamakrishnaHash:
Collaboration diagram for SystemEx.Hash.RamakrishnaHash:

Public Member Functions

 RamakrishnaHash (Endian endian)
 Craate a new instance.
Hash32 Compute (FixedVector< byte > input, uint seed)
 Computes the Ramakrishna hash of the given input.
Hash64 ComputeLong (FixedVector< byte > input, ulong seed)
 Computes the Ramakrishna hash of the given input.

Constructor & Destructor Documentation

◆ RamakrishnaHash()

SystemEx.Hash.RamakrishnaHash.RamakrishnaHash ( Endian endian)

Craate a new instance.

Parameters
endianThe suing endian for creating a hash
33 {
34 m_endian = endian;
35 }

Member Function Documentation

◆ Compute()

Hash32 SystemEx.Hash.RamakrishnaHash.Compute ( FixedVector< byte > input,
uint seed )

Computes the Ramakrishna hash of the given input.

Parameters
inputThe input data to hash.
seedThe seed value for the hash computation.
Returns
The computed Ramakrishna hash as a 32-bit value.

Implements SystemEx.Hash.IHash.

43 {
44 uint hash = seed;
45
46 for ( int i = 0 ; i < input.Count ; i++ ) {
47 hash ^= (hash << 5) + (hash >> 2) + input[i];
48 }
49
50 hash ^= (hash >> 16);
51 return new Hash32(hash);
52 }

◆ ComputeLong()

Hash64 SystemEx.Hash.RamakrishnaHash.ComputeLong ( FixedVector< byte > input,
ulong seed )

Computes the Ramakrishna hash of the given input.

Parameters
inputThe input data to hash.
seedThe seed value for the hash computation.
Returns
The computed Ramakrishna hash as a 64-bit value.

Implements SystemEx.Hash.IHash.

60 {
61 ulong hash = seed;
62
63 for ( int i = 0 ; i < input.Count ; i++ ) {
64 hash ^= (hash << 5) + (hash >> 2) + input[i];
65 }
66
67 hash ^= (hash >> 32);
68 return new Hash64(hash);
69 }

The documentation for this class was generated from the following file:
  • RamakrishnaHash .cs