Crates.io | awid |
lib.rs | awid |
version | 1.1.0 |
source | src |
created_at | 2024-06-10 17:36:12.623652 |
updated_at | 2024-06-11 18:16:21.161086 |
description | Small, simple, universally unique identifiers. |
homepage | |
repository | https://github.com/Normantas/awid |
max_upload_size | |
id | 1267418 |
size | 10,177 |
A small, simple, and universally unique identifier.
Awid's have 5 bytes of random data, which has 2^40 possible combinations.
That is 1,099,511,627,776 possible combinations for each second.
Snowflake - 64 bits (8 bytes)
Awid - 72 bits (9 bytes)
Xid - 96 bits (12 bytes)
UUID - 128 bits (16 bytes)
Note: ID's have different use cases. A large size isn't always a bad thing.
Creating an Awid takes 50ns, and creating an Awid with a supplied timestamp takes 15ns.
From this it seems the main bottleneck is getting the Unix time from the OS.
These tests were done on my local machine, results may vary.
To run these tests yourself, copy the Git repo and run cargo bench
.
Licensed under either of
at your option.
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.