This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DebuggerTypeProxy(typeof(HashSetDebugViewInt<>))] | |
[DebuggerDisplay("Count = {Count}")] | |
[Serializable] | |
public class BigStack<T> : IEnumerable<T> | |
{ | |
public BigArray<T> _array; | |
public BigStack() : this(BigArray<T>.Granularity) | |
{ | |
} | |
public BigStack(ulong capacity) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
public class BigArray<T> : IEnumerable<T>, IDisposable | |
{ | |
private const int ShiftCount = 19; | |
public const ulong Granularity = 1 << 19; | |
private T[][] _arrays; | |
private bool _disposed; | |
private ulong _itemSize; | |
private ulong _numberOfArrays; | |
public string Tag; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DebuggerTypeProxy(typeof(HashSetDebugViewInt<>))] | |
[DebuggerDisplay("Count = {Count}")] | |
[Serializable] | |
public class BigDictionary<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>> | |
{ | |
public BigSet<TKey> Keys; | |
public int Resizes; | |
public BigArray<TValue> Values; | |
public BigDictionary() : this(BigArray<TKey>.Granularity, new BigComparer<TKey>()) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DebuggerTypeProxy(typeof(HashSetDebugViewInt<>))] | |
[DebuggerDisplay("Count = {Count}")] | |
[Serializable] | |
public class BigHashSet<T> : IEnumerable<T> | |
{ | |
private readonly BigSet<T> _set; | |
public BigHashSet() : this(new BigComparer<T>()) | |
{ | |
} | |
public BigHashSet(IBigEqualityComparer<T> comparer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BigComparer<T> : IBigEqualityComparer<T> | |
{ | |
private static FNV1a64 hash; | |
private static Type _type; | |
public bool Equals(T x, T y) | |
{ | |
if (x == null || y == null) | |
return false; | |
return object.Equals((T)x, (T)y); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GetObjectSize | |
{ | |
public enum SetValueEnum | |
{ | |
NotSet = -1, | |
Yes = 1, | |
No = 0 | |
} | |
private SetValueEnum _isPrimitive; | |
private int _primitiveSize; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
public class BigSet<T> | |
{ | |
internal IBigEqualityComparer<T> _comparer; | |
internal BigArray<ulong> _hashBuckets; | |
internal BigArray<Slot> _slots; | |
internal ulong Count; | |
internal ulong Position; | |
internal int Version; | |
public BigSet() : this(BigArray<T>.Granularity, new BigComparer<T>()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BigIntegerPrimality | |
{ | |
public static readonly int[] Primes4k = | |
{ | |
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, | |
157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, | |
317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, | |
499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, | |
683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, | |
883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CryptoGetBytes : RandomNumberGenerator | |
{ | |
private readonly int _hashSizeInBytes; | |
private int _availableCacheBytes; | |
private volatile byte[] _buffer; | |
private volatile byte[] _cache; | |
private volatile int _ptr; | |
public HashAlgorithm Algorithm; | |
#if DEBUG | |
public TinyDictionary<int, long> BytesRequestList = new TinyDictionary<int, long>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CryptoEntropy | |
{ | |
public readonly TinyHashSet<byte[]> _entropyTest; | |
public CryptoEntropy() | |
{ | |
EntropyRequested = 0; | |
_entropyTest = new TinyHashSet<byte[]>(new ArrayComparer()); | |
} | |
public byte[] Entropy => GetEntropy(); | |
public int EntropyRequested{get; private set;} |