sqids / sqids-elixir Goto Github PK
View Code? Open in Web Editor NEWOfficial Elixir port of Sqids. Generate short unique IDs from numbers.
Home Page: https://sqids.org/elixir
License: MIT License
Official Elixir port of Sqids. Generate short unique IDs from numbers.
Home Page: https://sqids.org/elixir
License: MIT License
Like in Elixir’s hashids
lib mentioned in the website. Params will rarely change, so this makes sense as a simpler alternative to generating code with use Sqids
, when we wish to ease management of context.
In other words: support @sqids Sqids.new!(…)
-like usage.
It's configured; all that's missing is enabling it in repo settings.
No need to break builds in Sqids dependents due to warnings that may show up in the future.
At the moment, I'm the sole owner: https://hex.pm/packages/sqids
Not ideal as far as the bus factor goes.
This is setup as a GHA workflow which is to run daily (schedule currently disabled) and invokes a shell script which runs the Elixir updater script itself, which automatically updates the dependency locks and the changelog upon there being any changes.
Upon that happening, a branch is pushed and a PR is opened.
All that's likely missing is setting up additional permissions in the repo settings.
It would be helpful to users who are familiar with the existing elixir hashid lib https://github.com/alco/hashids-elixir to know how you compare.
As of time of writing, this is not yet the case:
https://github.com/sqids/sqids-elixir/actions/runs/9194903873
Why decode!/2
does not have a public non-throwing counterpart?
I've just tried integrating this into an app as I like the ID format, but it crashes in production due to the assert
you are using from ExUnit. It would be great to have something in the docs about this, although I'd argue you shouldn't be using it in non-test code
This was the error:
** (UndefinedFunctionError) function ExUnit.Assertions.__equal__?/2 is undefined (module ExUnit.Assertions is not available)
ExUnit.Assertions.__equal__?(22, nil)
(sqids 0.1.2) lib/sqids/alphabet.ex:113: Sqids.Alphabet.index_of!/2
(sqids 0.1.2) lib/sqids.ex:426: Sqids.decode_valid_id/2
(sqids 0.1.2) lib/sqids.ex:165: Sqids.decode!/2
I'm using the compile time config
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.