Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 5 Next »

Map object into hash space + Map cache into hash space

1- Define a static class Hashing : Executing static class to provide UInt32 hashcode for any object

/// UInt32 range is 0 to 4,294,967,295
/// Use the fastest hashing that has the least duplicates
const UInt32 m = 0x5bd1e995;
const Int32 r = 24;

[StructLayout(LayoutKind.Explicit)]
struct BytetoUInt32Converter
{
      [FieldOffset(0)]
      public Byte[] Bytes;

      [FieldOffset(0)]
      public UInt32[] UInts;
}

  • No labels