I sometimes transmit binary data or thinks like session ids over http. when
using base64 the problem is in the chars '+', '/' and '='. So i changed base64
to use '-', '_' and '!' instead. After this change no modification is done to the
string as with the '+' sign and i do not have the problems of '=', '/' which would
have to be url encoded what makes the string longer. In fact the 65 characters
i use now are those 71 characters which have neither a protocol function nor
have to be encoded (RFC1321). As these characters have no meaning in
filesystems as well things like session ids (len % 4 == 0) which are often used
for filenames as well can have shorter names with this encoding. And last but
not least these characters have no meaning with regular expressions.
In addition i could make the functions accept hexadecimal values as well
because (i suppose) in most such cases the input/output is hexadecimal.
Reference: RFC1321 MD5, RFC2396 URI, RFC2616 HTTP
Any comments?
marcus
"Man will never reach the moon,
regardless of all future scientific advances"
Dr. Lee de Forest, inventor of the Audion tube
and father of the radio, Feb. 25, 1967
--------------->>> http://www.marcus-boerger.de <<<----------------