Created
November 15, 2019 19:26
-
-
Save jbeezley/d9c2693bed925d15e67979996444c9d7 to your computer and use it in GitHub Desktop.
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
def int_to_uuid(id): | |
h = hex(int(id) << 65)[2:] | |
assert len(h) <= 32 | |
for i in range(len(h), 32): | |
h = '0' + h | |
assert len(h) == 32 | |
return h[:8] + '-' + h[8:12] + '-' + h[12:14] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment