Created
January 22, 2016 21:25
-
-
Save brianv0/d5c6c23e685d935f42b4 to your computer and use it in GitHub Desktop.
Random Client ID
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 uuid | |
import struct | |
import base64 | |
u = uuid.uuid4() | |
max_int64 = 0xFFFFFFFFFFFFFFFF | |
packed = struct.pack('>QQ', (u.int >> 64) & max_int64, u.int & max_int64) | |
client_id = base64.b64encode(packed) | |
print client_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment