I have a list of numbers and I want to shuffle it with a key and redo it. I am using it as a small encryption algorithm so I need to re-shuffle or get the original list from the suffled list.
original = [10, 20, 30, 25, 45, 68, 25]
shuffled = shuffle(original, key=10)
print shuffled
# >>> [25, 30, 25, 10, 20, 45, 68]
print re_shuffle(shuffled, key=10)
# >>> [10, 20, 30, 25, 45, 68, 25]
This is the idea of what I want. Is there a library or algorithms for this ?