I’m implementing serial key functionality in my application. User needs to enter at least 64bit number in order to register the application. Because typing number like 9,223,372,036,854,775,807 will take a while I want to compress it a bit. The first guess was to code this number hexadecimally but it still is quite long (0x7FFF FFFF FFFF FFFF).
Is there any standard method in .NET to code this number alphanumerically using for example: digits, upper-case and lower-case characters?
Base 64 is probably what you want. It allows all the uppercase and lowercase characters, and two symbol characters (+ and /)
Convert.ToBase64String will convert a number to a string.
Convert.FromBase64String converts string back to number.
Alternatively, if you want just uppercase characters (and digits 2-7) then you could use Base32, but there isnt a native implementation for that in .net. Some further info here : Base32 Decoding