/snowflake

Primary LanguageGoMIT LicenseMIT

snowflake

Build Status Go Report

About

This package is a snowflake implementation in Golang without lock.

Getting Started

Installing

go get github.com/LuckyStarry/snowflake

Usage

uid := snowflake.NextID()

or you have an explicit worker id (machine id) like this:

uid := snowflake.NextIDWorker(workerId)

Copyright and license

Code and documentation copyright 2017 Sun Bo. Code released under the MIT license.