Skip to content

Instantly share code, notes, and snippets.

@tzvsi
Created August 7, 2020 17:51
Show Gist options
  • Save tzvsi/100c969cc2a06331387a614667d74341 to your computer and use it in GitHub Desktop.
Save tzvsi/100c969cc2a06331387a614667d74341 to your computer and use it in GitHub Desktop.
Create a Deterministic / Reproducible GUID (RFC 4122) from String
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