8 releases (4 stable)

Uses old Rust 2015

1.3.0 May 13, 2017
1.2.0 Apr 25, 2016
1.1.0 Jan 10, 2016
1.0.0 Jun 29, 2015
0.5.0 Jan 31, 2015

#571 in Development tools

Download history 17022/week @ 2023-12-07 4323/week @ 2023-12-14 4162/week @ 2023-12-21 5055/week @ 2023-12-28 3922/week @ 2024-01-04 3623/week @ 2024-01-11 4112/week @ 2024-01-18 3677/week @ 2024-01-25 3236/week @ 2024-02-01 2923/week @ 2024-02-08 3360/week @ 2024-02-15 3014/week @ 2024-02-22 2746/week @ 2024-02-29 3229/week @ 2024-03-07 3239/week @ 2024-03-14 6311/week @ 2024-03-21

15,948 downloads per month
Used in 72 crates (19 directly)

MIT/Apache

11KB
196 lines

Build Status

A crate for quickly generating unique IDs with guaranteed properties. This library is completely unrelated to twitter's snowflake library.

This crate currently includes guaranteed process unique IDs but may include new ID types in the future.

API Docs: https://stebalien.github.io/snowflake/snowflake/

Usage

Add this to your Cargo.toml:

[dependencies]
snowflake = "1.2"

and this to your create root:

extern create snowflake;

To add support for serialization and deserialization using serde, add this to your Cargo.toml:

[dependences]
snowflake = { version = "1.2", features = ["serde_support"] }

Warning: there is a risk of non-unique IDs if (de)serialization is used to persist IDs, i.e. reading and writing IDs to and from a file.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~180KB