Documentation
¶
Overview ¶
A viable globally unique ID generation method. It is recommended to use industry-proven ID generation schemes, such as Universally Unique identifiers (UUID), Snowflake algorithm, etc., rather than implement it yourself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewId ¶
func NewId() string
NewId generates a globally unique ID in thread safety mode. The generation rule is [4 bytes timestamp] + [4 bytes local IP] + [2 bytes process ID] + [4 bytes auto-incremented sequence number] + [2 bytes reserved, set to 0] All numerical segments use the BigEndian order.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.