View PolyNomial.cs
public class PolyNomial
{
public int[] _coefficients;
public PolyNomial()
{
}
public PolyNomial(int degree)
{
_coefficients = new int[degree];
}
View MMTimer.cs
public class MMTimer : IDisposable
{
private const int EventTypePeriodic = 1;
private const uint STATUS_SUCCESS = 0;
private const uint STATUS_TIMER_RESOLUTION_NOT_SET = 0xC0000245;
private readonly MultimediaTimerCallback Callback;
private bool disposed;
private bool enabled;
private bool highestPossibleResolution;
private int interval, resolution;
View GetObjBytes.cs
public static byte[] GetObjBytes(object obj, Type type = null)
{
Type _type;
if (type == null)
_type = obj.GetType();
else
_type = type;
switch (_type.Name)
{
case "Byte":
View GetBytesEx.cs
public static class GetBytesEx
{
/// <summary>
/// Get Bytes from a single boolean object
/// </summary>
public static byte[] GetBytes(this bool obj)
{
return new[] {obj ? (byte) 1 : (byte) 0};
}
/// <summary>
View TinyHashSet.cs
public class TinyHashSet<T> : IEnumerable<T>
{
private readonly IEqualityComparer<T> _comparer;
private int[] _hashBuckets;
private uint[] _hashcodes;
private int[] _next;
public T[] Items;
public int Version;
public TinyHashSet() : this(1, EqualityComparer<T>.Default)
{
View TinyDictionary.cs
public class TinyDictionary<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>
{
private readonly IEqualityComparer<TKey> _comparer;
private int[] _hashBuckets;
private uint[] _hashcodes;
private int[] _next;
private TinyHashSet<TValue> _searchValues;
public TKey[] Keys;
public TValue[] Values;
public int Version;
View Zobristhashing32.cs
/// <summary>
/// https://en.wikipedia.org/wiki/Zobrist_hashing
/// Faster then GetHashCode, 6 collisions / 435,000 English words, ~20 Collisions / 400,000
/// random byte patterns.
/// </summary>
public class ZOB64 : HashAlgorithm
{
private ulong[] _table;
private ulong hash;
private uint hash32;
View Zobristhashing64.cs
public class ZOB64 : HashAlgorithm
{
private ulong[] _table;
private ulong hash;
private uint hash32;
private readonly ulong starthash = 0x391615744853B307;
private ZOB32State zhs;
public ZOB64()
{
hash = starthash;
View FNV1a1024.cs
public class FNV1a1024 : HashAlgorithm
{
private readonly BigInteger _K = "5016456510113118655434598811035278955030765345404790744303017523831112055108147451509157692220295382716162651878526895249385292291816524375083746691371804094271873160484737966720260389217684476157468082573".NewBigInteger10();
private BigInteger _hash;
private readonly BigInteger Seed = "14197795064947621068722070641403218320880622795441933960878474914617582723252296732303717722150864096521202355549365628174669108571814760471015076148029755969804077320157692458563003215304957150157403644460363550505412711285966361610267868082893823963790439336411086884584107735010676915".NewBigInteger10();
public FNV1a1024()
{
_hash = Seed;
}
public FNV1a1024(string seed)
View FNV1a512.cs
public class FNV1a512 : HashAlgorithm
{
private readonly BigInteger _K = "35835915874844867368919076489095108449946327955754392558399825615420669938882575126094039892345713852759".NewBigInteger10();
private BigInteger _hash;
private readonly BigInteger Seed = "9659303129496669498009435400716310466090418745672637896108374329434462657994582932197716438449813051892206539805784495328239340083876191928701583869517785".NewBigInteger10();
public FNV1a512()
{
_hash = Seed;
}
public FNV1a512(string seed)