Exemplo n.º 1
0
        public void Initialize()
        {
            hashedList = new List <M3Hash>();

            using (var sr = new StreamReader("hash.txt"))
            {
                while (!sr.EndOfStream)
                {
                    string s = sr.ReadLine();

                    Array.Resize(ref hashList, hashList.Length + 1);
                    hashList[hashList.Length - 1] = s;
                }
            }


            for (var i = 0; i < hashList.Length; i++)
            {
                var    hash        = hashList[i];
                byte[] stringbytes = Encoding.ASCII.GetBytes(hash);
                M3Hash hashItem    = new M3Hash();
                hashItem.name = hash;
                hashItem.hash = FNV.Hash32(stringbytes, 0, stringbytes.Length);
                hashedList.Add(hashItem);
            }
        }
Exemplo n.º 2
0
 public void Initialize()
 {
     hashedList = new List <M3Hash>();
     for (var i = 0; i < hashList.Length; i++)
     {
         var    hash        = hashList[i];
         byte[] stringbytes = Encoding.ASCII.GetBytes(hash);
         M3Hash hashItem    = new M3Hash();
         hashItem.name = hash;
         hashItem.hash = FNV.Hash32(stringbytes, 0, stringbytes.Length);
         hashedList.Add(hashItem);
     }
 }