Created
July 25, 2017 04:09
-
-
Save lukeaus/52e7f6a2708f221975419989122a6951 to your computer and use it in GitHub Desktop.
Convert id to hash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashids | |
SALT = "this is my salt" | |
hash_func = hashids.Hashids(salt=SALT, min_length=16) | |
hash_ = hash_func.encode(1,) # ''JEDngB0NV05ev1Ww' | |
ids = hash_func.decode(hash_) # (1,) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment