Created
December 2, 2014 06:54
-
-
Save prologic/1661b2a121d5dff7d78d to your computer and use it in GitHub Desktop.
created by github.com/tr3buchet/gister
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
>>> from random import randint | |
>>> import struct | |
>>> inc = randint(0, 0xFFFFFF) | |
>>> oid = struct.pack(">i", inc)[1:4] | |
>>> inc | |
3266098 | |
>>> oid | |
'1\xd62' | |
>>> inc = (inc + 1) % 0xFFFFFF | |
>>> inc | |
3266099 | |
>>> | |
>>> oid = struct.pack(">i", inc)[1:4] | |
>>> inc = (inc + 1) % 0xFFFFFF | |
>>> inc | |
3266100 | |
>>> | |
>>> oid | |
'1\xd63' | |
>>> | |
>>> oid = struct.pack(">i", inc)[1:4] | |
>>> inc = (inc + 1) % 0xFFFFFF | |
>>> inc | |
3266101 | |
>>> oid | |
'1\xd64' | |
>>> | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment