Converting Numbers To Shorter/Easier to Convey Strings

John Avis by | October 18, 2007 | Classic ASP Web Development

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

Computers & Internet Web Development Website Hosting

500 Internal Server Error after migrating from IIS 7.5 to IIS 10

by John Avis | November 4, 2019

As support ends for Microsoft Windows Server 2008 I have recently gone through migrating some websites to a new server running Windows Server 2016 and IIS 10 but some of the websites did not work.


Jquery/Javascript Web Development

tagInput: A simple jQuery plugin for tag entry using Bootstrap 4

by John Avis | October 15, 2019

For a website project I needed a way to enter multiple tags. I just wanted something simple that I could easily modify to suit my own needs, so I wrote my own.


ASP.NET Web Forms Web Development

ASP.NET bug with RadioButton GroupName in Repeater

by John Avis | September 1, 2019

I rediscovered a bug in ASP.NET that affects RadioButtons inside repeaters. Here is my solution to the problem.

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

About me

...random postings about web development and programming, Internet, computers, electronics and automotive topics.

Subscribe

Get the latest posts delivered to your inbox.