snowflake_id

Crates.iosnowflake_id
lib.rssnowflake_id
version1.0.1
sourcesrc
created_at2021-09-22 03:11:55.697099
updated_at2021-09-22 07:31:51.31292
descriptionSnowFlake is an algorithm adopted by Twitter, whose purpose is to generate globally unique and trend-increasing IDs in a distributed system.
homepagehttps://github.com/choby/idgenerator_rs
repositoryhttps://github.com/choby/idgenerator_rs
max_upload_size
id454704
size587,912
shift (choby)

documentation

https://github.com/choby/idgenerator_rs/blob/main/snowflake/readme.md

README

SnowFlake is an algorithm adopted by Twitter, whose purpose is to generate globally unique and trend-increasing IDs in a distributed system.

How many globally unique IDs can the SnowFlake algorithm generate in the same millisecond? Number of IDs in the same millisecond = 1024 X 4096 = 4194304

let mut worker = Snowflake::new(1, 1);

let id = worker.next();

Commit count: 18

cargo fmt