Created
August 7, 2020 17:51
-
-
Save tzvsi/100c969cc2a06331387a614667d74341 to your computer and use it in GitHub Desktop.
Create a Deterministic / Reproducible GUID (RFC 4122) from String
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 hashlib | |
import uuid | |
seed = 'foo' | |
m = hashlib.md5() | |
m.update(seed.encode('utf-8')) | |
new_uuid = uuid.UUID(m.hexdigest()) | |
print(new_uuid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment