Ticket
Unique-ID-Generator inspired by rs/xid.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
) (
9 _____ ___ ___ _ _____ _____ 7
6 |_ _|_ _/ __| |/ / __|_ _| 1
3 | | | | (__| ' <| _| | | 6
8 |_| |___\___|_|\_\___| |_| 5
0 2
)_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _(
About Ticket
The ID generated from Ticket only occupies 12 bytes.
- 4-byte from unix timestamp,
- 3-byte from machine id,
- 2-byte from current process id, and
- 3-byte counter which starting with a random value.
Usage
Put this in your Cargo.toml
:
[]
= { = "https://github.com/Hanaasagi/ticket" }
Use it like following
extern crate ticket;
use ;
License
BSD 3-Clause License Copyright (c) 2018, Hanaasagi