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

Update code according to latest spec. #6

Merged
merged 18 commits into from
Oct 13, 2023
Merged

Update code according to latest spec. #6

merged 18 commits into from
Oct 13, 2023

Conversation

laserpants
Copy link
Collaborator

No description provided.

@laserpants
Copy link
Collaborator Author

laserpants commented Oct 13, 2023

@4kimov: This is now up-to-date with the latest version of the spec., including the tests. I'd appreciate it if you could have a quick look.

✨ I have also added Big Int support, as explained in the README file: ✨

The library exposes two versions of the API;

  • Web.Sqids relies on Haskell's Int data type, whereas
  • Web.Sqids.Integer uses Integers, which support arbitrarily large integers.

If you need to work with (i.e., encode and decode) large numbers, it is recommended to choose the latter option, in which case you would import the library as:

import Web.Sqids.Integer

The Haskell standard (see here) guarantees the range supported by Int to have an upper bound of at least 229 - 1 (= 536,870,911). If this does not present a problem for your use case, instead use:

import Web.Sqids

The code snippets on the web site are still correct.

@laserpants laserpants merged commit 1e02656 into main Oct 13, 2023
1 check passed
@4kimov
Copy link
Member

4kimov commented Oct 13, 2023

@laserpants Very nice, good job. And even Bit Int support! 💪

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

Successfully merging this pull request may close these issues.

2 participants