This question already has an answer here:
- All your bijective base are belong to us 8 answers
The task is to convert a string to a number. It must accept the string via stdin and output the number via stdout.
You convert a string to a number by replacing each letter of the string by its index (mind that you don't need to replace it with the index, that's just an example. You are allowed to replace it with anything you like, as long as the output is decodable) in the following list (you don't need to convert any other characters):
abcdefghijklmnopqrstuvwxyz1234567890 (the input will only either be lowercase letters, or/and a number).
Additionally, you must make the output decodable, so if you have output
0 for input
a, and somebody inputs
bl, then the output will be something like
111. This is not decodable since the program might interpret it as
bl. You might make it decodable by making sure the the number that each character outputs always has a length of 2. Any other way of making sure your output is decodable is allowed, but you must explain how one would decode the output in your answer.
Standard loopholes are not allowed. This is code golf, so shortest code wins!
EDIT: By decodable, just to clarify, I mean that you can convert the output back into the input. Your program doesn't need to feature decoding features, only encoding.
Input Output a 00 ab 0001 1 26