in reply to Re^2: How can I encode a string using only lower case letters and numbers?
in thread How can I encode a string using only lower case letters and numbers?
Will also deal with the full range of byte values, 0..255:
$b36 = ''; $b36 .= encode_base36( $_, 7 ) for map unpack('V', $_), unpack '(Z4)*' +, 'ASillyLongstringWithFunnyCharacters!"£$%^&*():;@#~{[]}`¬¦|\/?';; print $b36;; 0U2W3EP0UVQCMK0WB704U0SP59PU0SZDAHJ0UN2HQE0R0Z2IH0WAKHV609A4RJ90AB0EG2 +0B56YQM0HTL7HL0PDSILF1B9UICD0D52TWD $s = ''; $s .= pack 'V', $_ for map decode_base36( $_ ), unpack '(a7)*', $b36;; print $s;; ASillyLongstringWithFunnyCharacters!"£$%^&*():;@#~{[]}`¬¦|\/
|
|---|