id

package
v0.0.63 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL