Beispiel #1
0
        //tex fnvhash from https://gist.github.com/RobThree/25d764ea6d4849fdd0c79d15cda27d61 check.cs
        public static string FNV1Hash32Str(string text)
        {
            var fnvHash = new FNV1Hash32();
            var value   = fnvHash.ComputeHash(Encoding.UTF8.GetBytes(text));//DEBUGNOW encoding? -v-
            var hash    = fnvHash.HashSize == 32 ? BitConverter.ToUInt32(value, 0) : BitConverter.ToUInt64(value, 0);

            return(hash.ToString());
        }//FNV1Hash32Str
        //tex fnvhash from https://gist.github.com/RobThree/25d764ea6d4849fdd0c79d15cda27d61 check.cs
        public static uint FNV1HashConvert(string text)
        {
            var fnvHash = new FNV1Hash32();
            var value   = fnvHash.ComputeHash(Encoding.UTF8.GetBytes(text));//DEBUGNOW encoding? -v-
            var hash    = BitConverter.ToUInt32(value, 0);

            return(hash);
        }//FNV1Hash32Str