public void TestStringLookup() { foreach (string Text in this.DistinctTexts) { MacroscopeStringLookup.Lookup(Text: Text); } foreach (string Text in this.RandomizedTexts.Keys) { ulong value = MacroscopeStringLookup.Lookup(Text: Text); ulong found = 0; bool not_found = true; for (int k = 0; k < this.DistinctTexts.Count(); k++) { if (this.DistinctTexts[k] == Text) { found = (ulong)k; not_found = false; break; } else { not_found = true; } } Assert.IsFalse(not_found); Assert.AreEqual(value, found); } }
/** Text Numeeric Digest **************************************************/ public static ulong StringToDigest(string Text) { ulong value = MacroscopeStringLookup.Lookup(Text: Text); return(value); }