Author Topic: Base 42  (Read 893 times)

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Base 42
« on: October 25, 2006, 02:17:29 PM »
Ok, google has failed me.  I've got some values stored in base 42 and need to convert them.

Examples:
Code: [Select]
0!!7!
0RLYU
0RL_0
0RM$N
0S@!9
0S@!@
0S@!A
0RM%_
0RM@H

Here's what I came up with, but I'm not 100% sure it's right:
Code: [Select]
g_mBase42Remap['!'] = 0;
g_mBase42Remap['$'] = 1;
g_mBase42Remap['%'] = 2;
g_mBase42Remap['-'] = 3;
g_mBase42Remap['0'] = 4;
g_mBase42Remap['1'] = 5;
g_mBase42Remap['2'] = 6;
g_mBase42Remap['3'] = 7;
g_mBase42Remap['4'] = 8;
g_mBase42Remap['5'] = 9;
g_mBase42Remap['6'] = 10;
g_mBase42Remap['7'] = 11;
g_mBase42Remap['8'] = 12;
g_mBase42Remap['9'] = 13;
g_mBase42Remap['@'] = 14;
g_mBase42Remap['A'] = 15;
g_mBase42Remap['B'] = 16;
g_mBase42Remap['C'] = 17;
g_mBase42Remap['D'] = 18;
g_mBase42Remap['E'] = 19;
g_mBase42Remap['F'] = 20;
g_mBase42Remap['G'] = 21;
g_mBase42Remap['H'] = 22;
g_mBase42Remap['I'] = 23;
g_mBase42Remap['J'] = 24;
g_mBase42Remap['K'] = 25;
g_mBase42Remap['L'] = 26;
g_mBase42Remap['M'] = 27;
g_mBase42Remap['N'] = 28;
g_mBase42Remap['O'] = 29;
g_mBase42Remap['P'] = 30;
g_mBase42Remap['Q'] = 31;
g_mBase42Remap['R'] = 32;
g_mBase42Remap['S'] = 33;
g_mBase42Remap['T'] = 34;
g_mBase42Remap['U'] = 35;
g_mBase42Remap['V'] = 36;
g_mBase42Remap['W'] = 37;
g_mBase42Remap['X'] = 38;
g_mBase42Remap['Y'] = 39;
g_mBase42Remap['Z'] = 40;
g_mBase42Remap['_'] = 41;

KnacK

  • Global Moderator
  • Autococker
  • Posts: 3039
Re: Base 42
« Reply #1 on: October 25, 2006, 02:27:06 PM »
Try this:

http://math2.org/math/general/numnotation.htm

Bottom of the page.  Go from any base to any base.

0!!7! = 301 in base10

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Base 42
« Reply #2 on: October 25, 2006, 05:29:00 PM »
Seems what I did panned out.  We found some records that had both the base42 and base10 value stored.  0!!7! = 12447246.

KnacK

  • Global Moderator
  • Autococker
  • Posts: 3039
Re: Base 42
« Reply #3 on: October 26, 2006, 08:30:02 AM »
Why or what did you have in base42??

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Base 42
« Reply #4 on: October 26, 2006, 11:52:02 AM »
Some system we were converting.  Why?  I guess it was for filenames, but that's just a guess.