sqids / sqids-go

Official Go port of Sqids. Generate short unique IDs from numbers.
https://sqids.org/go
MIT License
492 stars 8 forks source link

Anti-pattern: Trailing bool in `encodeNumbers` #7

Closed peterhellberg closed 10 months ago

peterhellberg commented 11 months ago

While spotting this (which is probably a mistake):

https://github.com/sqids/sqids-go/blob/addde54a3501a7a2d475e7844ef9baf3c16ebbe7/sqids.go#L157-L159

I think we should remove this anti-pattern in the first place and have two functions for encoding partitioned numbers and not.

peterhellberg commented 10 months ago

Solved by the algorithm in the spec having changed.

Related to issue #23