Python unlock value

I'm new to python. Can I figure it out, or rather, how can I make out the meaning. I am using the std hash () function. What I would like to do is first assign a hash value and then expand it as such:

#process X
hashedVal = hash(someVal)
#send n receive in process Y
someVal = unhash(hashedVal)
#for example print it
print someVal

thanks in advance

+3
source share
3 answers

This is impossible to do.

The hash is not a compressed version of the original value; it is a number (or something similar) derived from the original value. The nature of the implementation of the hash is that it is possible (but statistically unlikely if the hashing algorithm is good) that two different objects create the same hash value.

Pigeonhole, , N M , N , M (.. , ), , . - , , , .

, , . .

, ( ) - 3 (.. 3). :

1 --> 1  <--+- same hash number, but different original values
2 --> 2     |
3 --> 0     |
4 --> 1  <--+

- , :

  • ( , , )
  • ( , - )
  • ( , -/ , )

...?

, , , " ".

, 3 :

  • /, , gzip zlib ( / )
  • /, , RSA, AES .
  • /, , , ,
+19

. - , python hash .

0

Source: https://habr.com/ru/post/1749218/


All Articles