A
Alfred von Campe
I must have a brain cramp today, because I can not figure out an
elegant way to do the following. I have a 16 byte, binary MD5 digest
(generated with Digest::MD5) in one scalar, and another scalar
containing exactly 256 printable characters. I want to create a
printable version of the MD5 digest by using the bytes of the digest
as an index into the string of printable characters. I can do this in
a loop one byte at a time, but there must be a solution using map
and/or pack/unpack to do this more elegantly. Any ideas?
Alfred
elegant way to do the following. I have a 16 byte, binary MD5 digest
(generated with Digest::MD5) in one scalar, and another scalar
containing exactly 256 printable characters. I want to create a
printable version of the MD5 digest by using the bytes of the digest
as an index into the string of printable characters. I can do this in
a loop one byte at a time, but there must be a solution using map
and/or pack/unpack to do this more elegantly. Any ideas?
Alfred