Digital Paint Discussion Board
Digital Paint Community => Other Stuff => Topic started by: jitspoe on October 25, 2006, 04:17:29 PM
-
Ok, google has failed me. I've got some values stored in base 42 and need to convert them.
Examples:
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:
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;
-
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
-
Seems what I did panned out. We found some records that had both the base42 and base10 value stored. 0!!7! = 12447246.
-
Why or what did you have in base42??
-
Some system we were converting. Why? I guess it was for filenames, but that's just a guess.