snowflake

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NodeMax = 1<<nodeBits - 1 // 1023

)
View Source
const (
	NodeMax53 = 1<<nodeBits53 - 1 // 1023

)

Variables

View Source
var Epoch uint64 = 1684812000000

Functions

This section is empty.

Types

type Snowflake

type Snowflake struct {
	// contains filtered or unexported fields
}

func New

func New(cluster, node, clusterBits uint64) (*Snowflake, error)

func (*Snowflake) Next

func (sf *Snowflake) Next() uint64

type Snowflake53

type Snowflake53 struct {
	// contains filtered or unexported fields
}

func New53

func New53(cluster, node, clusterBits uint64) (*Snowflake53, error)

func (*Snowflake53) Next

func (sf *Snowflake53) Next() uint64

Jump to

Keyboard shortcuts

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