in reply to decimal to binary
Taken from the pack manpage.sub bintodec { unpack("N", pack("B32", substr("0" x 32 . shift, -32))); }
And this seems to work for a dectobin, although there's probably a faster way w/o using join:
sub dectobin { join '', unpack "B32", pack "N", shift; }
|
---|