in reply to Re^3: Perl equivalent of Java code
in thread Perl equivalent of Java code
Apparently, bytes as considered signed in Java. No problem.
I could fix the map, but it's getting quite long. It's easier to just use pack and unpack.
my $key = "0123456789ABCDEF0123456789ABCDEF"; local $_ = $key; s/^0+//; $_ = "0$_" if length % 2 == 1; $_ = "00$_" if /^[89ABCDEFabcdef]/; my @b = unpack('c*', pack('H*', $_));
|
|---|