Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by roboticus (Chancellor)
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)

Replies are listed 'Best First'.
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?
[marto]: X86_instruction_li stings
[marto]: Illegal_opcode
[zentara]: marto arn't those NSA secrets? :-)
[marto]: not if you keep telling people :P
[zentara]: I had to disable hyperthreading on my machine because of that.
[Discipulus]: thanks marto but... at the moment this seems a bit beyond my faculties.. ;=)
[zentara]: a thread goes into a wait state after emitting a wait to all other threads. It locks up a machine completely.
[marto]: if you mean the recent hyperthreading bug, I don't think that's NSA related?
[zentara]: s/thread/cpu/
[marto]: xkcd://538

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2017-07-28 12:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (428 votes). Check out past polls.