Documentation ¶
Index ¶
Constants ¶
View Source
const ( SecondsBits = 32 // 时间戳所占位数 NodeIDBits = 12 // 节点ID位数 SequenceBits = 20 // 序列号 MaxSeconds = 1<<32 - 1 // 最大时间戳 MaxNodeID = 1<<10 - 1 // 最大节点ID MaxSequence = 1<<22 - 1 // 最大序列号 SecondsMask = 0xFFFFFFFF00000000 // 时间戳掩码 SecondsShift = 32 // 时间戳移位 NodeIDMask = 0x00000000FFF00000 // 节点ID掩码 NodeIDShift = 20 // 节点ID移位 SequenceMask = 0x00000000000FFFFF // 序号掩码 SequenceShift = 0 // 序号移位 CustomEpoch = 1640966400 // 开始时间 2022-01-01 00:00:00 UTC )
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.