Converting Numbers To Shorter/Easier to Convey Strings

John Avis by | October 18, 2007 | Classic ASP

These functions convert a number into a shorter string containing both text and numbers.

Possible uses include where you may have a reference number that you don't want to look as if it is sequential and easy to pick, and/or if you want a refernce number that people could quote easier (because it is shorter).

Basically, it converts the number into a Base-34 number (similar to hexadecimal which is Base-16, or binary which is Base-2. Decimal is Base-10).

An advantage to this script, however, is that it doesn't use the letter 'I' or the letter 'O' so there can never been any confusion between them and the numbers one and zero.

To call the script simply use ToBase34(your-number) to convert to the string, then FromBase34(converted-string) to convert back to decimal.

Show sample

Related Posts

ASP.NET Web Forms Classic ASP

Custom error pages for ASP.NET Web Forms and Classic ASP in IIS 7 and 8.5

by John Avis | February 20, 2019

I was recently doing some work on a website which has a mixture of older Classic ASP pages and ASP.NET Web Forms pages and ran into problems with custom error pages.


Classic ASP

Sending email using Amazon SES with Classic ASP

by John Avis | March 21, 2017

I recently needed to change a client's website to send emails using Amazon SES and encountered a few issues.


Classic ASP

Classic ASP class constructors with parameters

by John Avis | June 8, 2016

Although probably no one cares about Classic ASP, except those who still need to support it, I was refreshing my memory today on how to use classes in Classic ASP and found a couple of options for simulating constructors with parameters.

Comments

by Freeman | February 26, 2008

You make my day!

Reply

by Philip | July 31, 2009

Fantastic! Saved me tons of work!

Reply

Leave a Comment
Tags
ASP.NET Html Forms ASP.NET MVC ASP.NET Web Forms ASP.NET Web Pages Bootstrap C# Classic ASP Cool Websites Databases eBay and PayPal Electrical Repairs General Hardware HTML/CSS Jquery/Javascript Media Center Mobile Phones Responsive Web Design Reviews SEO and Social Networking Web Design Web Development Web Security web+db Website Hosting Windows XP Youtube

About me

...mostly about web development and programming, with a little bit of anything else related to the Internet, computers and technology.

Subscribe

Get the latest posts delivered to your inbox.