コード例 #1
0
 public void AddValue(ulong keyHash, T value)
 {
     if (value != null)
     {
         _estimator.Add(_byteConverter.ToByteArray(value));
     }
 }
コード例 #2
0
        public void AddValue(ulong keyHash, T value)
        {
            ulong hash = 1;

            if (value != null)
            {
                var    bytes  = _byteConverter.ToByteArray(value);
                byte[] result = _murmurHash.ComputeHash(bytes);
                hash = BitConverter.ToUInt64(result, 0);
            }

            AddHash(hash);
        }
コード例 #3
0
ファイル: Hasher.cs プロジェクト: bmdub/AutoStat
        public ulong GetHash(T value)
        {
            ulong hash = 1;

            if (value != null)
            {
                var    bytes  = _byteConverter.ToByteArray(value);
                byte[] result = _murmurHash.ComputeHash(bytes);
                hash = BitConverter.ToUInt64(result, 0);
            }

            return(hash);
        }