public bool TryGetValue(LazyUTF8String name, out FolderEntryData value) { int index = this.GetSortedEntriesIndexOfName(name); if (index >= 0) { value = this.sortedEntries[index]; return(true); } value = null; return(false); }
public string HashedChildrenNamesSha() { using (HashAlgorithm hash = SHA1.Create()) { for (int i = 0; i < this.ChildEntries.Count; i++) { FolderEntryData entry = this.ChildEntries[i]; // Name only byte[] bytes = Encoding.UTF8.GetBytes(entry.Name.ToString()); hash.TransformBlock(bytes, 0, bytes.Length, null, 0); } hash.TransformFinalBlock(new byte[0], 0, 0); return(SHA1Util.HexStringFromBytes(hash.Hash)); } }