Merge branch 'FIX'

dev_timestamp
Harald Wolff 2019-08-31 00:33:24 +02:00
commit 94e648406b
2 changed files with 20 additions and 0 deletions

View File

@ -248,6 +248,18 @@ namespace ln.types
return slice;
}
public static string ToHexString(this byte[] bytes)
{
StringBuilder stringBuilder = new StringBuilder();
for (int n = 0; n < bytes.Length; n ++)
{
stringBuilder.AppendFormat("{0:X2}", bytes[n]);
}
return stringBuilder.ToString();
}
public static string HexDump(this byte[] bytes)
{
StringBuilder stringBuilder = new StringBuilder();

View File

@ -99,6 +99,14 @@ namespace ln.types.btree
return false;
}
public int Count(K key)
{
List<V> _values = null;
if ((!bTree.TryGet(key, ref _values)) || (_values.Count == 0))
return 0;
return _values.Count;
}
public IEnumerable<K> Keys => bTree.Keys;
public IEnumerable<V> Values => bTree.Values.SelectMany(vl => vl);
}