diff options
| author | Kyren223 <kyren223@proton.me> | 2025-08-08 23:25:17 +0300 |
|---|---|---|
| committer | Kyren223 <kyren223@proton.me> | 2025-08-08 23:25:17 +0300 |
| commit | 375cd7a0f5fcf6c92ca02d24b8c61179decd4f41 (patch) | |
| tree | c7ae0b2b0cb5871d4372d84228890a9cd888f4d3 /pkg | |
| parent | 3842aa28cf74e90dd0998b2a4343f9ad83766b60 (diff) | |
Add more readme info
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/snowflake/snowflake.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/snowflake/snowflake.go b/pkg/snowflake/snowflake.go index 890f278..d369134 100644 --- a/pkg/snowflake/snowflake.go +++ b/pkg/snowflake/snowflake.go @@ -75,9 +75,9 @@ func NewNode(node int64) *Node { assert.Assert(nodeBits+stepBits == 22, "node and step bits must add up to 22") assert.Assert(0 <= node && node <= NodeMax, "node must be within 0 and NodeMax", "node", node) - // Credit to https://github.com/bwmarrin/snowflake + // NOTE(kyren): Credit to https://github.com/bwmarrin/snowflake currentTime := time.Now() - // add time.Duration to curTime to make sure we use the monotonic clock if available + // add time.Duration to currentTime to make sure we use the monotonic clock if available epoch := currentTime.Add(time.Unix(Epoch/1000, (Epoch%1000)*1000000).Sub(currentTime)) return &Node{ |
