Use Base 36 for transaction ID’s

After the transaction with your website, your customer needs a ticket number of the purchase/reservation/vote/et.al for tracking purposes. When it comes to making that a number your customer can easily write down on a piece of paper, why limit yourself to just the top row of the keyboard —why not use letters, too?

It turns out this is an easy way to cut the size of tracking codes in half. So, change the radix of your number to something higher than, base 10…

Since there are 26 letters in the alphabet, how about adding 10 + 26 = 36. The base 36 numbering system effectively uses all of the easy symbols on a keyboard which are also easy to repeat to customer service over the telephone.

Let’s use 36 as our radix. Here is how in JavaScript:


var x=+new Date,
y=x.toString(36),
z=parseInt(y,36);
console.log(x+" » "+y+" « "+z);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: