Skip to content

tknf/snowflake-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snowflake ID for Go

This is the simplest Snowflake ID generator library.

For production use, I recommend bwmarrin/snowflake.

Installation

go get github.com/tknf/snowflake-go

Usage

package main

import (
  "fmt"
  "github.com/tknf/snowflake-go"
)

func main() {
  s := snowflake.NewSnowflake(1)
  id := s.Generate()
  fmt.Println(id)
}

License

MIT License