using System.Globalization;
private const string Base36Chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var guid = "b5ac92a0-1bcf-4e5d-8075-968070aac768";
var replaced = guid.Replace("-", "");
if (replaced.Length != 32)
Console.WriteLine("Error: The GUID string is not valid after removing dashes.");
var mainPart = replaced[..20];
var secondary = replaced[20..];
mainPart = "0" + mainPart;
secondary = "0" + secondary;
Console.WriteLine($"Main Part: {mainPart}");
Console.WriteLine($"Secondary Part: {secondary}");
if (BigInteger.TryParse(mainPart, NumberStyles.HexNumber, null, out BigInteger mainBigInt) &&
BigInteger.TryParse(secondary, NumberStyles.HexNumber, null, out BigInteger secondaryBigInt))
var sum = mainBigInt + secondaryBigInt;
Console.WriteLine(mainBigInt);
Console.WriteLine(secondaryBigInt);
var base36 = ToBase36(sum);
Console.WriteLine(ToBase36(mainBigInt));
Console.WriteLine(ToBase36(secondaryBigInt));
Console.WriteLine(base36);
Console.WriteLine("Error: Failed to parse one or both of the BigInteger parts.");
catch (FormatException e)
Console.WriteLine("Error parsing one of the parts as BigInteger: " + e.Message);
public static string ToBase36(BigInteger value)
StringBuilder result = new StringBuilder();
int remainder = (int)(value % 36);
result.Insert(0, Base36Chars[remainder]);
return result.ToString();