Skip to content

Instantly share code, notes, and snippets.

@LesterLian
Created May 19, 2023 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LesterLian/3191b79aece8a8e5d235825d23ab18fb to your computer and use it in GitHub Desktop.
Save LesterLian/3191b79aece8a8e5d235825d23ab18fb to your computer and use it in GitHub Desktop.
UUID5 with salt
from uuid import UUID, uuid5
from hashlib import md5
salt = 'SALT'
uid = input('Enter uid: ')
salt_hash = md5(salt.encode('utf-8')).digest()
namespace = UUID(bytes=salt_hash)
print(uuid5(namespace, uid))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment