/// <summary>
 /// GetHashCode64
 /// </summary>
 /// <param name="k"></param>
 /// <returns></returns>
 public unsafe long GetHashCode64(ref string k)
 {
     fixed (char* c = k)
     {
         return Utility.HashBytes((byte*)c, k.Length * sizeof(char));
     }
 }
 /// <summary>
 /// GetHashCode64
 /// </summary>
 /// <param name="k"></param>
 /// <returns></returns>
 public unsafe long GetHashCode64(ref byte[] k)
 {
     fixed (byte* b = k)
     {
         return Utility.HashBytes(b, k.Length);
     }
 }
Пример #3
0
 public unsafe long GetHashCode64(ref SpanByte spanByte)
 {
     if (spanByte.Serialized)
     {
         byte *ptr = (byte *)Unsafe.AsPointer(ref spanByte);
         return(Utility.HashBytes(ptr + sizeof(int), spanByte.Length));
     }
     else
     {
         byte *ptr = (byte *)spanByte.Pointer;
         return(Utility.HashBytes(ptr, spanByte.Length));
     }
 }
Пример #4
0
 public static long GetHash(Key *key)
 {
     return(Utility.HashBytes((byte *)key, kSizeInBytes));
 }
Пример #5
0
 ///<inheritdoc/>
 public unsafe long GetHashCode64(ref ReadOnlyMemory <T> k)
 {
     fixed(T *ptr = k.Span)
     return(Utility.HashBytes((byte *)ptr, k.Length * sizeof(T)));
 }