bwmarrin / snowflake

A simple to use Go (golang) package to generate or parse Twitter snowflake IDs
BSD 2-Clause "Simplified" License
2.98k stars 371 forks source link

fix: overflow in ParseBase58/ParseBase32 #45

Closed dnephin closed 2 years ago

dnephin commented 2 years ago

Fixes #42

The ID should not be allowed to overflow an int64. The test cases added here fail before the code change.

dnephin commented 2 years ago

After doing some more testing with fuzz tests I see this is not at all the right way of dealing with overflow.