arbitrary base conversion in javascript
what to do: enter all the 'digits' of the bases you want to convert between in the "base/alphabet" fields, then enter a value you want to convert in one of the "value" fields, then click the appropriate "click!" button to convert it to the other base. note, this works for arbitrary bases, but the values must be non-negative integers less than 2^31. i was a bit surprised to completely fail in finding an online arbitrary base converter which didn't need a download, so wrote this real quick-like. note that the stock decimal alphabet is "0123456789", but you could do something crazy like "987654310" if you want. this would make a handy decoder ring type thing, if only the number values could be arbitrarily large too.. thanks to "ben" for pointing out that "#" is not URL-safe. and to patrick for pointing out that "+" isn't, either. and to "mike" for pointing out that for SMS urls, only [a-zA-Z0-9] are safe. orion elenzil 20080905 |