/// <summary> /// Gets the hash of a byte array. /// </summary> /// <param name="bytes">The bytes.</param> /// <param name="seed">The seed.</param> /// <returns>The hash.</returns> public UInt192 GetHash(byte[] bytes, UInt192 seed) { Documents.UInt128 hash128 = MurmurHash3.Hash128(bytes, bytes.Length, Documents.UInt128.Create(seed.GetLow(), seed.GetMid())); ulong hash64 = MurmurHash3.Hash64(bytes, bytes.Length, seed.GetHigh()); return(UInt192.Create(hash128.GetLow(), hash128.GetHigh(), hash64)); }
/// <summary> /// Gets the hash of a byte array. /// </summary> /// <param name="bytes">The bytes.</param> /// <param name="seed">The seed.</param> /// <returns>The hash.</returns> public static UInt192 GetHash(byte[] bytes, UInt192 seed) { // TODO: Have MurmurHash3 work on Span<T> instead. Documents.UInt128 hash128 = Microsoft.Azure.Documents.Routing.MurmurHash3.Hash128( bytes, bytes.Length, Documents.UInt128.Create(seed.GetLow(), seed.GetMid())); ulong hash64 = Microsoft.Azure.Documents.Routing.MurmurHash3.Hash64(bytes, bytes.Length, seed.GetHigh()); return(UInt192.Create(hash128.GetLow(), hash128.GetHigh(), hash64)); }