How would you convert an arbitrary string into a unique integer, which would be the same across Python sessions and platforms? For example hash('my string') wouldn’t work because a different value is returned for each Python session and platform.
How would you convert an arbitrary string into a unique integer, which would be
Share
If a hash function really won’t work for you, you can turn the string into a number.
This is invertible, by mapping each triplet through
chr.