skip to Main Content
+971 55 881 1725 hmimthiaz @ imthi.com

New Base36 Method

I was developing a small utility for my brother Fathah to generate a barcode of all the items in shop.

I was not happy with the normal id method it’s so generic and everyone is using the same thing. So I thought of doing a new base including numbers and alphabets. So my new base36 include digits from 0-9 and A-Z.

One place holder has to rotate 35 times to increase the next place holder. I don’t whether it allowed in computing world. But is seems to me it can compress huge numbers very easily.

For Example

Base 10 = 46655232
Base 36 = ARRZEO

Base 10 = 2176782335
Base 36 = ZZZZZ it is the maximum in 5 digit.

I have implemented this in Visual basic and I am not sure how far it is optimized for speed. It will crash if really calculating big numbers :-). If any one does a better one please forward it to me.

You can download this module which is in class format.

Base36 Code.

Have Fun…

This Post Has 2 Comments
  1. Good job. I noticed two small problems, however.

    First, the initialization sub does not work in VB for MS Access with the syntax “Sub Init()”
    Access requires this to be “Sub Class_Initialize()”.

    Second, your math is off just a little bit. Examine this section as written in your Encode sub:
    “TempX = Round((TempX / 36) – 0.5)”

    This can cause the function to encode a digit incorrectly. It is mathematically correct to use the following:
    “TempX = Fix(TempX / 36)” OR “TempX = Int(TempX / 36)”
    Either will properly drop the fractional portion of the remainder.

    All in all you did an excellent job. This class is much smaller than most base conversion scripts I’ve seen. It helped me out a lot.

Comments are closed.

Back To Top