in reply to Re: Re: (Golf) Cryptographer's Tool #1
in thread (Golf) Cryptographer's Tool #1

nice, srawls... here it is down to 51:
sub c{ ($_,$a)=@_;s!.!chr($h{$&}||=($a=~/./g,ord$&))!ge;$_ #23456789_123456789_123456789_123456789_123456789_1 }

It doesn't work with null either, but as i read it, thats fine.

update: oops, here's one that resets %h and is reusable, as per the given example, at 54:
sub c{ ($_,$a,%h)=@_;s!.!chr($h{$&}||=($a=~/./g,ord$&))!ge;$_ #23456789_123456789_123456789_123456789_123456789_1234 }
--sean