Base62 struct
Jeff Key 
August 27, 2003

I was working on a personal project and needed to display as much alphanumeric info in as little space as possible, while treating the characters as numbers.  I came up with this struct, which is a Base62 data type.  It's a good example of creating a struct for use as a data type, including the following:

Example:

Base62 num = "10";   // Results in an int value of 62
num == 62       // True
num == "10"     // True
num < 63        // True
num < "Z"       // False
num + 1 == 63   // True
num + "1" == 63 // True

Good stuff to know if you ever need it.  (Pardon the algorithms if they aren't the most efficient; I'm not a CS guy.)

Download   

Back to dotnet