public static void Main()
Console.WriteLine("Hello World");
Console.WriteLine(Encode(25638476234, 8));
public static string Encode(decimal number, int width)
var nmlOut = new StringBuilder("000000000000000000");
var letters = new StringBuilder("BCDFGHJKLMNPQRSTVWXZ");
decimal nDistinct = (decimal)Math.Pow(10, width);
if (width < 1 || width > 18)
throw new Exception("Not good 1");
for (lenPrefix = 0, lenSuffix = width; lenPrefix <= width; ++lenPrefix, --lenSuffix)
throw new Exception("Not good 2");
decimal offset = number - oldMin;
for (; lenSuffix > 0; lenSuffix--)
nmlOut[lenPrefix + lenSuffix - 1] = (char)('0' + offset % 10);
for (; lenPrefix > 0; lenPrefix--)
nmlOut[lenPrefix - 1] = letters[(int)(offset % 100) % 20];
return nmlOut.ToString()[..width];