3 ms·
Can somebody help me understand this conversion? Shard ID = (241294492511762325 >> 46) & 0xFFFF = 3429 Type ID = (241294492511762325 >> 36) & 0x3FF = 1 Loca
by uptown 11y ago
Can somebody help me understand this conversion?
Shard ID = (241294492511762325 >> 46) & 0xFFFF = 3429
Type ID = (241294492511762325 >> 36) & 0x3FF = 1
Local ID = (241294492511762325 >> 0) & 0xFFFFFFFFF = 7075733
- econner 11y agoThese are bit shift operations with a bitmask. Basically the ids are 64-bit and sections are reserved to identify the shard, type, and local id.
- blyxa 11y agobitwise operations. 241294492511762325 >> 46 means shift the binary form of number which is 0000001101011001010000000001000000000000011010111111011110010101 to the right 46 spaces while replacing with 0s 0000000000000000000000000000000000000000000000000000110101100101 0xFFFF is hex version of 1111111111111111 (note two missing bits he reserved for gold :D ) & 0xFFFF is doing a AND operation of the bits. 0000110101100101 1111111111111111 ---------------- 0000110101100101 so 0000110101100101 in decimal is 3429