Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Converting a number back to it's original string (that was hashed to generate that number)

by Nik
on Jan 23, 2013 at 16:49 UTC ( #1014958=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Converting a number back to it's original string (that was hashed to generate that number)
in thread Reaped: Converting a number back to it's original string (that was hashed to generate that number)

blue_cowdawg's code

my @i = split(//,$url); # put each letter in it's own bin my $j=0; # Initailize our my $k=1; # hashing increment values my @m=(); # workspace foreach my $n(@i){ my $q=ord($n); # ASCII for character $k += $j; # Increment our hash offset $q += $k; # add our "old" value $j = $k; # store that. push @m,$q; # save the offsetted value } my $hashval=0; #initialize our hash value # Generate that map { $hashval = ($hashval + $_) % 100000} @m;
Is this the solution i seek to turn an 'absolute path' <=> '5-digit number' ?


Comment on Re^4: Converting a number back to it's original string (that was hashed to generate that number)
Download Code
Re^5: Converting a number back to it's original string (that was hashed to generate that number)
by blue_cowdawg (Monsignor) on Jan 23, 2013 at 16:51 UTC
        Blue_coward

    At least get my handle correct.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
      I have corrected your handle, sorry for that

      Is this the solution i seek to turn an 'absolute path' <=> '5-digit number' in a bi-directional way?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014958]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-11-23 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (134 votes), past polls