I need to generate a hash from a tuple. Ideally I would have liked to able to do it from a list, but that's not possible. I need something that I can use the hash to generate back the tuple, to finally access the original list with the items in the right order (items will be strings).
Here's what I'm trying to hash
l = ['x', 'y', 'z']
t = tuple(l)
I tried using hash()
, but that ended up not giving the same hash across Python sessions, which is something I need.
I need the hash because I want to create a file based off that list with the hash as the filename. I then want to lookup the file name and be able to access the list items (in the correct order) using just the hash.
My understanding is that this is possible, but I could be wrong. Any ideas?