cryoid 0.1.0

extremely lightweight ID generator inspired by Snowflake
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::Layout;

#[derive(Debug, Clone,Copy, Eq, PartialEq)]
pub struct Compact48;

impl Layout for Compact48 {
    const TIMESTAMP_BITS: u8 = 32;
    const TAG_BITS:        u8 = 0;
    const MACHINE_BITS:    u8 = 8;
    const SEQUENCE_BITS:   u8 = 8;
    const EPOCH:       u64 = 1_777_680_000_000;
}