Let me describe the scenario first.
What I'm trying to do is convert a string to hex.
For example let's say a binary string comprising of 1s & 0s viz. 110011, pairing them as a group of 4 digits(appending two 0s for 8 digits here), converting each pair into hex separately and then joining the hex string result to obtain the output.
For octal, same as was for binary but here input octal string is split into groups of 3 digits
For ASCII, each digit's byte equivalent is converted to hex and stored.
Now the problem is what should I do for decimal string input?
-Should I consider using the same method as that for ASCII? -Or is there another way?
EDIT :-
I'm not just converting numbers, but converting an array of numbers.
Binary string - groups of 4 digits & then convert them to hex
Octal string - groups of 3 digits & then convert them to hex
ASCII string - byte equivalent for each character & then convert that to hex
So length isn't the issue. The issue is how to convert the decimal string(what sort of pairing/grouping should I use)
NOTE : I already know about converting octal, binary & decimal numbers to hex. This part is more about how to "divide the decimal string into groups" so as to convert each decimal group into hex separately and then joining the resultant hex.