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

Implement the new simplified/improved algorithm #20

Merged
merged 7 commits into from
Sep 9, 2023
Merged

Conversation

aradalvand
Copy link
Collaborator

To enforce the maximum of 255.
Since it was introduced in .NET 7 and other target frameworks
don't support it.
@aradalvand aradalvand merged commit bff3a8c into main Sep 9, 2023
1 check passed
@aradalvand aradalvand deleted the simpler branch September 9, 2023 17:25
@LeaFrock
Copy link
Contributor

I see the changes in unit tests. I wonder whether v3 will output a different id for a pointed int number with v2, even though the alphabet and other configs are all the same?

@aradalvand
Copy link
Collaborator Author

aradalvand commented Sep 10, 2023

Hi @LeaFrock, actually yes, v3 outputs different IDs than v2 even with the same configurations, because as you can see in this PR, the algorithm has been modified, which brings about a number of major improvements — you can learn more about those in sqids/sqids-spec#11 — but it does result in a breaking change.

Most Sqids ports (this one being an exception) were on pre-release versions, so it made sense to do this now. Though we don't plan to introduce any more breaking changes in the algorithm; this one, however, was very much justified because it fixed a few important issues the previous version of the algorithm had.

@LeaFrock
Copy link
Contributor

Well, it sounds reasonable, though it indeed makes some troubles to me. We've already been using this library in our production.

we don't plan to introduce any more breaking changes in the algorithm

Hope so. And I also hope Sqids releases a stable(rather than pre-release) version for production soon. Thanks for your reply!

@aradalvand
Copy link
Collaborator Author

aradalvand commented Sep 11, 2023

Well, it sounds reasonable, though it indeed makes some troubles to me. We've already been using this library in our production.

Understandable. Sorry for the inconvenience. I didn't actually know whether anyone was already using the library in production but I assumed it's probably not that many people, since it has been only a few weeks since the library was published; hopefully the transition goes smoothly for you.

@LeaFrock
Copy link
Contributor

I imported HashIds in the last project, and it has been running well since 2021. Recently we create a new project and at the very first time I want to choose HashIds again.

When I'm going to check if there's a new release on the website, I'm surprised that HashIds rebrands to Sqids. Therefore ... you know the rest of the story 🤣 .

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