2024-09-24 21:44:29 +00:00
|
|
|
# Icechip
|
|
|
|
|
|
|
|
A snowflake library that actually does what it is supposed to.
|
|
|
|
|
|
|
|
Adheres to the twitter specification, but also has an improved mode.
|
|
|
|
|
|
|
|
## Twitter Specification
|
|
|
|
| u64 or i64 | | | |
|
|
|
|
|:-:|:-:|:-:|:-:|
|
2024-09-25 00:19:24 +00:00
|
|
|
| bits 0-40 | bits 41-51 | bits 52-62 | 63 |
|
2024-09-24 21:44:29 +00:00
|
|
|
| time since an epoch in ms | machine id | sequence number | sign |
|
|
|
|
|
|
|
|
## Enhanced Specification
|
|
|
|
|
|
|
|
Utilizes a 64 bit unsigned integer, moves the now spare sign bit and one sequence bit to the machine ID.
|
|
|
|
|
|
|
|
| u64 |||
|
|
|
|
|:-:|:-:|:-:|
|
2024-09-25 00:19:24 +00:00
|
|
|
| 0-40 | 41-53 | 54-63 |
|
2024-09-24 21:44:29 +00:00
|
|
|
| time since an epoch in ms | machine id | sequence number |
|
|
|
|
|
|
|
|
## Extended Enhanced Specification
|
|
|
|
|
|
|
|
Utilizes a 128 bit unsigned integer. 32bit machine id, 32bit sequence number. (*Ought to be enough for anybody™*)
|
|
|
|
|
|
|
|
| u128 |||
|
|
|
|
|:-:|:-:|:-:|
|
2024-09-24 21:45:52 +00:00
|
|
|
| 0-63 | 64-95 | 96-127 |
|
2024-09-24 21:44:29 +00:00
|
|
|
| full unix timestamp ms | machine id | sequence number |
|