Created
February 10, 2017 12:29
-
-
Save laszlocsontos/d389f80f35d379d262f6f193dd78df5f to your computer and use it in GitHub Desktop.
64-bit unique ID generator
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
long getUID(byte sid, long time, byte tid, byte serial) { | |
return (sid & 0x7fL) << 56 | (time & 0xffffffffffL) << 16 | (tid & 0xff) << 8 | (serial & 0xff); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment