From 9b811d89f0d2ba395224269ed9d36e528e6de29d Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Mon, 13 Mar 2023 07:51:12 -0600 Subject: [PATCH] initial --- README.md | 15 +++++++++++++++ go.mod | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 README.md create mode 100644 go.mod diff --git a/README.md b/README.md new file mode 100644 index 0000000..3fbb45d --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# Snowflake UID Service + +* (0..41] bits for .01s since $EPOCH (697y span) +* (41..54] bits for sequence (4096) +* (54..64] bits for hostid (1024 hosts) + +for up to `419_430_400 = 1024*100*4096` ids per second + +## Original + +* source: https://github.com/twitter-archive/snowflake/tree/snowflake-2010 +* tldr + * [0..41] bits for timestamp + * (41..x] bits for hostid + * (x..64) bits for sequence diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1692e07 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module snowflake-uid-service + +go 1.20