Beefy Boxes and Bandwidth Generously Provided by pair Networks kudra
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Re: (Golf) Cryptographer's Tool #1

by sean (Beadle)
on Jun 20, 2001 at 01:08 UTC ( [id://89885]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://89885]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.