Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by roboticus (Canon)
on Jan 23, 2013 at 14:00 UTC ( #1014907=note: print w/ replies, xml ) Need Help??


in reply to Re^2: 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)

Nik:

What part of my post was unclear? If you're going to persist, then you, not us, are going to have to figure out the mapping, ensure the constraints on the string, and write the python code.

I'll speak no more on the topic.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re^3: Converting a number back to it's original string (that was hashed to generate that number)
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
    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' ?
          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://1014907]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2014-09-17 17:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (92 votes), past polls