snowflake-multi-threaded

Crates.iosnowflake-multi-threaded
lib.rssnowflake-multi-threaded
version0.1.4
sourcesrc
created_at2018-03-27 13:19:11.624961
updated_at2019-07-04 03:51:12.540026
descriptionThe rust-lang implementation of Twitter's id generator algorithm snowflake, it thread safety | Twitter 的id生成器算法snowflake的rust-lang 实现
homepagehttps://github.com/hanskorg/snowflake-rust.git
repositoryhttps://github.com/hanskorg/snowflake-rust.git
max_upload_size
id57752
size8,287
(hanskorg)

documentation

https://github.com/hanskorg/snowflake-rust/blob/master/README.md

README

snowflake-rust

snowflake is a lib for generating unique ID

this project is rust-lang implementation of Twitter's id generator algorithm snowflake

Twitter 的id生成器算法snowflake的rust-lang 实现

Build Status

Usage

Add this to your Cargo.toml:

[dependencies]
snowflake-multi-threaded = "0.1.0"
 let workerId:i64 = 1;
 let datacenterId:i64 = 1;
 let mut id_gen = SnowFlakeId::new(workerId,datacenterId);
 println!("{}", id_gen.generate().unwrap());
Commit count: 21

cargo fmt