Skip to content

Instantly share code, notes, and snippets.

@rossmurray
Last active December 17, 2015 16:49
Show Gist options
  • Save rossmurray/5641434 to your computer and use it in GitHub Desktop.
Save rossmurray/5641434 to your computer and use it in GitHub Desktop.
public string ConvertToBase(uint value, char[] characterSet)
{
var radix = (uint)characterSet.Length;
var result = string.Empty;
do
{
var remainder = value % radix;
value = value / radix;
result = characterSet[remainder] + result;
} while(value > 0);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment