http://www.perlmonks.org?node_id=1192885


in reply to Re^3: Signed Long Hash
in thread Signed Long Hash

Thanks. What I was trying to do was something similar, but this might not yield the same results to what i'm trying to achieve? I thought I had to convert the value to an array of bytes first and then convert that to base64. Something like:

$signed="-281581062704388899"; $bits = unpack("B*", pack("N", $signed)); $base64 = encode_base64(pack("B*", $bits), ""); #or $base64 = encode_base64($bits);