If I have two strings that are identical in value, is it guaranteed that hash(s1) == hash(s2) without using hashlib? Also, what is the upper bound on the number of digits in the hash?
Is there an alternative to hash that is invertable? I understand hash functions are not meant to be used like this. But a 1-1 mapping from strings to short hexadecimal strings that can be inverted and is guaranteed to be different for each string?
Will this work:
import zlib
# compress
zlib.compress("foo")
zlib.decompress(zlib.compress("foo")) == "foo" # always true?
Thanks.
YES.