Skip to content

基于 Twitter-Snowflake 64位自增ID算法理论实现的分布式、线程安全自增ID生成器

Notifications You must be signed in to change notification settings

geekfghuang/snowflake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A distributed, thread safe and self increasing ID generator based on the theory
of Twitter-Snowflake 64 bit self increasing ID algorithm

Usage:

    http:
        ./uid-http ../conf/worker.xml

    application:
        go get github.com/geekfghuang/snowflake

        func main() {
            worker, err := NewWorker(0)
            if err != nil {
                // ...
            }
            id, err := worker.NextId()
            // ...
        }

Attention!!!

    different worker, different workerId

About

基于 Twitter-Snowflake 64位自增ID算法理论实现的分布式、线程安全自增ID生成器

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages