MCPcopy Index your code
hub / github.com/davidaurelio/hashids-python / _unhash

Function _unhash

hashids.py:54–62  ·  view source on GitHub ↗

Restores a number tuple from hashed using the given `alphabet` index.

(hashed, alphabet)

Source from the content-addressed store, hash-verified

52
53
54def _unhash(hashed, alphabet):
55 """Restores a number tuple from hashed using the given `alphabet` index."""
56 number = 0
57 len_alphabet = len(alphabet)
58 for character in hashed:
59 position = alphabet.index(character)
60 number *= len_alphabet
61 number += position
62 return number
63
64
65def _reorder(string, salt):

Callers 1

_decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected