예제 #1
0
 public static string GetString(HashedString hashedString)
 {
     if (Lookup.ContainsKey(hashedString))
         return Lookup[hashedString];
     else
         return "";
 }
예제 #2
0
 public static void AddString(HashedString hashedString, string value)
 {
     if (!Lookup.ContainsKey(hashedString))
     {
         Lookup.TryAdd(hashedString, value);
     }
     else if (value != Lookup[hashedString])
     {
         throw new Exception("hash collision");
     }
 }