Crates.io | snowflake_id |
lib.rs | snowflake_id |
version | 1.0.1 |
source | src |
created_at | 2021-09-22 03:11:55.697099 |
updated_at | 2021-09-22 07:31:51.31292 |
description | SnowFlake is an algorithm adopted by Twitter, whose purpose is to generate globally unique and trend-increasing IDs in a distributed system. |
homepage | https://github.com/choby/idgenerator_rs |
repository | https://github.com/choby/idgenerator_rs |
max_upload_size | |
id | 454704 |
size | 587,912 |
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();