Skip to content

Instantly share code, notes, and snippets.

@jinuljt
Created August 14, 2017 02:57
Show Gist options
  • Save jinuljt/95df8927d4dcd0272c102d9479245085 to your computer and use it in GitHub Desktop.
Save jinuljt/95df8927d4dcd0272c102d9479245085 to your computer and use it in GitHub Desktop.
python ksuid
import time
import uuid
def ksuid():
return hex(int(time.time()))[2:] + uuid.uuid4().hex
@jinuljt
Copy link
Author

jinuljt commented Aug 14, 2017

2.4 GHz Intel Core i5

In [61]: %timeit ksuid()
12.7 µs ± 3.67 µs per loop (mean ± std. dev. of 7 runs, 100000 loops each)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment