-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoding can return negative values due to overflow #12
Comments
I believe that this is expected behavior.
Source: https://sqids.org/faq#valid-ids |
The following operation likely resulted in an overflow, exceeding the range of a long data type. |
I don't believe we should change this. The problem is that the input is malformed, so this is expected. This is the same even for the reference implementation in javascript. See: https://codesandbox.io/s/gallant-sky-g7qnrc?file=/src/index.ts @4kimov what is your opinion on that? |
To me, it sounds like a spec issue, not a Java implementation issue As of right now, All other scenarios are undefined -- which makes me lean towards leaving as-is, until spec is ironed out. For now, the good news is that re-encoding would catch this. |
@4kimov yep, sounds fair to me. Maybe add a more explicit entry in the FAQ? @robhanlon22 will leave it as is until it is addressed in the reference implementation. |
Minimum repro uses default alphabet, min length, and block list:
The text was updated successfully, but these errors were encountered: