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

feat: check Node/Step is ok #49

Closed szpnygo closed 1 year ago

szpnygo commented 1 year ago

It should be forced to detect that the number of digits of Note and Step does not exceed 22. If only one of them is modified, it will cause problems. I think this should be mandatory detection

bwmarrin commented 1 year ago

@szpnygo

Thanks for the PR. Seems like a fine check to add in there for safety :)