R – Creating the shortest possible case-insensitive verification number

asp-classicvbscriptweb-applications

This is going to be a little long and rambly, but I want to make sure everything is in the proper context.

Back in 2004 I wrote an online Learning Management System using Classic ASP and VBScript. I'm now working on some upgrades (and periodically asking myself WTF I was thinking when I wrote various segments of code…), and I want to take this opportunity to resolve one of the frequent complaints I get – the size of the verification numbers.

When you complete a test online, a verification number is displayed so if you needed to re-create your certificate of completion (its a hospital, and trying to get them to get rid of their paper is like asking Linus to give up his blanket) you can enter the number, etc. etc.

At the time I wrote it (and sadly still to this day) there is no unique identifier I can use to create a transcript page – so please don't post suggestions to that end. There's more going on than I care to get into, and I want to head off valid suggestions that I can't use. 😉

The verification number is a concatenation of various pieces of information (mostly because when I first wrote it I was an idiot newb and SO wasn't around), and while it is a much-appreciated feature there are a lot of complaints about how long the number is. Returning the raw ID at this point is no better as we're in the 6-digit range.

My initial idea was to use a Base64 encoding algorithm I got from elsewhere, but given the problems I've had with just numbers, I'm thinking changing it to a case-sensitive value is only asking for a different class of problems… which brings me to the question at hand:

What can I use to create the shortest possible case-insensitive verification number since hex won't reduce the length appreciably?

And as the tags indicate, I need to be able to implement it in ASP Classic/VBScript – migration is not an option at this point.

Edit: based on the answers, I found a link to Crockfor's implementation of Base32, which looks like what I'm looking for – http://www.crockford.com/wrmg/base32.html

Best Answer

Base36?

Edit: As Lucky mentions in the comments, using Base36 probably doesn't give any real advantage over Base32 in this situation.

Related Topic