sub bintodec { unpack("N", pack("B32", substr("0" x 32 . shift, -32))); } #### sub dectobin { join '', unpack "B32", pack "N", shift; }