public void Hint(string line) { ulong hash = Hash64.HashString(line); CheckCollision(hashes, hash, line); hashes[hash] = line; }
public bool Load() { try { using (StreamReader streamReader = new StreamReader((Stream) new FileStream("hashes.txt", FileMode.Open))) { for (string input = streamReader.ReadLine(); input != null; input = streamReader.ReadLine()) { ulong hash = Hash64.HashString(input, 0UL); this.CheckCollision(this.hashes, hash, input); this.hashes[hash] = input; } streamReader.Close(); } } catch (Exception ex) { return(false); } return(true); }
public static ulong HashString(string input, ulong level = 0) { return(Hash64.Hash(Encoding.UTF8.GetBytes(input), (ulong)Encoding.UTF8.GetByteCount(input), level)); }