Skip to content

Instantly share code, notes, and snippets.

@jstedfast
Created July 27, 2015 16:03
Show Gist options
  • Save jstedfast/24205f9cc043633d1957 to your computer and use it in GitHub Desktop.
Save jstedfast/24205f9cc043633d1957 to your computer and use it in GitHub Desktop.
using System;
using System.Text;
namespace Blah {
public class Program
{
public static void Main (string[] args)
{
const string base36 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
ulong value = ulong.MaxValue;
var id = string.Empty;
value = (ulong) args[0].GetHashCode ();
do {
id = base36[(int) (value % 36)] + id;
value /= 36;
} while (value != 0);
if (id.Length < 13)
id = new string ('0', 13 - id.Length) + id;
Console.WriteLine ("id = {0}", id);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment