Snowflakes are distributed and sortable IDs based on Twitter’s Snowflake algorithm.
By design, the IDs generated are intentionally predictable to maintain sortability. Do not use them for sensitive identifiers like session tokens.
go get github.com/ruhrcloud/snowflakeimport (
"fmt"
"github.com/ruhrcloud/snowflake"
)
func main() {
node, _ := snowflake.New(1)
id, _ := node.Generate()
fmt.Println(id.String())
}Full documentation is available on pkg.go.dev.
