Registry / utility / andersfylling-snowflake-v2

andersfylling-snowflake-v2

JSON →
library2.0.4gogounverified

A distributed unique ID generator inspired by Twitter's Snowflake.

go get github.com/andersfylling/snowflake/v2
INSTALL
IMPORT
SIG · ANDERSFYLLING-SNOW
A
andersfylling-snowflake-v2
utilitygov2.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

snowflake
github.com/andersfylling/snowflake/v2

Generates a unique Snowflake ID using a node with ID 1.

package main import ( "fmt" "github.com/andersfylling/snowflake/v2" ) func main() { // Create a new snowflake node with node ID 1 node, err := snowflake.NewNode(1) if err != nil { fmt.Println("Error:", err) return } id := node.Generate() fmt.Println("Generated ID:", id) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
2.0.4latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
23 hits · last 30 days
node
20
Meta
1
OpenAI (training)
1
Resources
andersfylling-snowflake-v2 — go get andersfylling-snowflake-v2 · libregistry