public required NUlid.Ulid Id { get; init; }
public required System.Ulid Id { get; init; }
public static void Main()
Console.WriteLine("Base32 Mapping Test");
var numinput = "010101TPQZTG46AVX665CT0EW4";
var letterinput = "oiololtpqztg46avx665ct0ew4";
var nnum = NUlid.Ulid.Parse(numinput);
var nletter = NUlid.Ulid.Parse(letterinput);
Console.WriteLine("NUlid");
Console.WriteLine($"input: {numinput}, output: {nnum}");
Console.WriteLine($"input: {letterinput}, output: {nletter}");
Console.WriteLine(nnum == nletter ? "equal" : "not equal");
var cnum = System.Ulid.Parse(numinput);
var cletter = System.Ulid.Parse(letterinput);
Console.WriteLine("Cysharp/Ulid");
Console.WriteLine($"input: {numinput}, output: {cnum}");
Console.WriteLine($"input: {letterinput}, output: {cletter}");
Console.WriteLine(cnum == cletter ? "equal" : "not equal");
Console.WriteLine("JSON Serialization Test");
var nserialized = JsonSerializer.Serialize(new NData {
var ndeserialized = JsonSerializer.Deserialize<NData>(nserialized);
Console.WriteLine("NUlid Serialized");
Console.WriteLine(nserialized);
Console.WriteLine($"deserialized id: {ndeserialized.Id}");
Console.WriteLine(ndeserialized.Id == nnum ? "seserialized equal to serialized input" : "deserialized not equal to serialized input");
var cserialized = JsonSerializer.Serialize(new CData {
var cdeserialized = JsonSerializer.Deserialize<CData>(cserialized);
Console.WriteLine("Cysharp/Ulid Serialized");
Console.WriteLine(cserialized);
Console.WriteLine($"deserialized id: {cdeserialized.Id}");
Console.WriteLine(cdeserialized.Id == cnum ? "deserialized equal to serialized input" : "deserialized not equal to serialized input");