using System.Collections.Generic;
static HashSet<string> hashes = new();
public static void Main()
for (int d = 0; d < 10000000; d++)
Console.WriteLine("Done");
public static class HashEx
public static int Hash(this object obj)
byte[] buffer = new byte[0];
buffer = Encoding.UTF8.GetBytes(obj.ToString());
buffer = BitConverter.GetBytes(Convert.ToDouble(obj));
return Math.Abs(BitConverter.ToInt32(XxHash32.Hash(buffer)));
public static bool IsNumber(this object obj)
Type objType = obj.GetType();
objType = Nullable.GetUnderlyingType(objType) ?? objType;
return objType != typeof(bool) && objType != typeof(char) && objType != typeof(IntPtr) && objType != typeof(UIntPtr);
return objType == typeof(decimal);
public static class BaseConverter
private const int Base = 48;
private const string Chars = "abcdefghjkmnopqrstuvwxyzABCDEFGHJKMNOPQRSTUVWXYZ";
public static string AsAlpha(this int value)
result = Chars[value % Base] + result;
return result.PadRight(6,'X');