Base62 encoder and decoder based on Base62 for PHP for .NET. This library is useful for converting data into shortened strings good for URL shortening and/or obfuscating auto-incrementing resource ids from being exposed through RESTful APIs.
Written to be netstandard compliant, this library should be able to be used cross-platform. See netstandard details for more information.
var base62Converter = new Base62Converter();
var encoded = base62Converter.Encode("120");
Console.WriteLine(encoded);
var decoded = base62Converter.Decode(encoded);
Console.WriteLine(decoded);
// output is:
// "DWjo"
// "120"
By default Base62 uses [0-9A-Za-z]
character set but can be alternated to use [0-9a-zA-Z]
through the constructor.
new Base62Converter(Base62Converter.CharacterSet.INVERTED);
...