added desc and updated README

This commit is contained in:
cbax 2024-09-29 01:53:44 -04:00
parent e57b0aadde
commit f13e04ff85
2 changed files with 6 additions and 2 deletions

View file

@ -2,7 +2,9 @@
name = "icechip" name = "icechip"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
description = "A mostly true to spec Twitter Snowflake implementation, with multiple modes."
repository = "https://git.cbax.dev/icechip" repository = "https://git.cbax.dev/icechip"
readme = "README.md"
license = "MIT" license = "MIT"
publish = true publish = true

View file

@ -2,12 +2,14 @@
A snowflake library that actually does what it is supposed to. A snowflake library that actually does what it is supposed to.
Adheres to the twitter specification, but also has an improved mode. (Mostly) adheres to the twitter specification, but also has an improved mode.
NOTE: Only enhanced and extended modes are available at this time. Twitter original spec is horridly painful to implement with generics, as it supports both u64 and i64 and ignores the sign bit completely in both modes. (essentially u63 and i64 modes).
## Twitter Specification ## Twitter Specification
| u64 or i64 | | | | | u64 or i64 | | | |
|:-:|:-:|:-:|:-:| |:-:|:-:|:-:|:-:|
| bits 0-40 | bits 41-51 | bits 52-62 | 63 | | 0-40 | 41-51 | 52-62 | 63 |
| time since an epoch in ms | machine id | sequence number | sign | | time since an epoch in ms | machine id | sequence number | sign |
## Enhanced Specification ## Enhanced Specification