# Encode an ascii string in base 15

How can I encode an ascii string in base 15?

In other words, I have the following characters available:

0123456789abcde


I have no idea how to do this. What do you suggest I do?

(If this is not on-topic, please migrate.)

• What are your thoughts? What approaches have you already considered? – D.W. May 1 '17 at 17:27
• What do you mean by "encode an ascii string in base 15"? Can you give some concrete examples. When you really understand the question enough that you can explain it clearly to other people, you will have a better idea of where to start looking for a solution. – Code-Guru May 1 '17 at 23:12

## 1 Answer

Let's take a different view angle.

The problem is not really about encoding something like "decimals numbers" 0..127 into base-15 (which is messy). It's about converting a base-127 string into base-15. If you can see it that way, then it's just the same principle as with converting from, say, base-16 (hex) to base-10 (decimal), or base-10 to base-2.