'Base 64' suggests you want 64 different "digits" to represent each combination of log2(64) = 6 bits. Text format also suggests 8 bits per character so that two bits would be unused. One simple format that contains only printable characters would be the 64 element subrange of ASCII from '0' (ASCII 48) to 'o' (ASCII 111), leading to the simple conversion algorithm of converting the 6 bits into ordinary octal, adding 48 and converting to ASCII using the perl pack, unpack and chr functions. For base 32, a similar idea could be used or you could just extend the hexadecimal format from 0..F to 0..V - but that would require supporting the gap in ASCII between '9' and 'A'.
-M
Free your mind
In reply to Re: Binary string to base64
by Moron
in thread Binary string to base64
by albert
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |