Skip to content
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

Negative long values throw an exception #18

Closed
sheitmann opened this issue May 9, 2016 · 4 comments
Closed

Negative long values throw an exception #18

sheitmann opened this issue May 9, 2016 · 4 comments

Comments

@sheitmann
Copy link

the issue seems to be in a lot of hashid implementations

@ullmark
Copy link
Owner

ullmark commented May 9, 2016

Yes, hashids doesn't support negative values. As stated in documentation. :)

On 9 maj 2016, at 09:13, Sven notifications@github.com wrote:

the issue seems to be in a lot of hashid implementations


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@sheitmann
Copy link
Author

oh ok, seems I did not see it.
maybe the method should check for negative long values and throw a meaningful exception and also the method documentation should note this. what you think about?

@ullmark
Copy link
Owner

ullmark commented May 9, 2016

Yes, to give a slightly longer answer. Some of the others implementations doesn't have all the features C# has. When building the port I thought about using uint instead of int since that would have made a truer APi. The problem is that not a lot of people use uint or even know that it exist so I decided against it. Didn't want ppl to do type casting all the time just to use hashids.

Yes, exceptions in hashids have also been a bit of a "should we follow the other libraries or throw exceptions".

I'll make the documentation more clear! I am currently working (when I have some time over) with converting the entire library to a "Portable Library" to support more platforms.

@Van-Dame
Copy link

Negative values are still a PITA when using this library. Can you consider extending the usage to uint and ulong parameters as well? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants