erikwang2013/hashids
Laravel/PHP wrapper for Hashids that encodes integers into short, unique, non-sequential IDs and decodes them back. Useful for obfuscating database IDs in URLs and APIs while keeping values reversible and configurable.
Snapshot: erikwang2013/hashids v1.3.1 — a Laravel wrapper around the hashids/hashids core library. The release notes for v1.3.1 contain only a compare link between v1.3.0 and v1.3.1; no changelog entries, no described changes, no linked issues or PRs. Treat the release as a presumed non-breaking patch based on semver position alone, not on verified content.
Architecture fit
Integration feasibility
Technical risk
| Risk | Severity | Notes |
|---|---|---|
| Reversibility misunderstood as security | High | Teams routinely assume "short and scrambled" means "secret". Needs an explicit, written architectural rule. |
| Salt is a hard, permanent commitment | High | Changing the salt or alphabet invalidates every previously issued identifier. Rotating the salt is a data-migration event, not a config change. |
| Collision / length pressure | Medium | Uniqueness depends on the integer space, minimum hash length, and alphabet chosen. Very large ID ranges or small alphabets can push you into longer or ambiguous strings. Must be validated against projected ID volume at 3–5 years, not today's row count. |
| Alphabet curation | Medium | Excluding look-alikes (0/O, 1/l/I) and profanity is a manual review task. The default alphabet should not ship unexamined to a consumer-facing surface. |
| Abandonware / fork drift | Medium-High | This is a small-maintainer fork of a previously popular wrapper. Contributor count, issue responsiveness, and release cadence are the real health signals — and this release gives us almost nothing to read. |
| Silent patch contents | Medium | v1.3.1 ships with no described changes. A patch could carry a dependency bump, an internal refactor, or a security-adjacent fix. The absence of a changelog is itself a governance finding. |
| Transitive dependency exposure | Low-Medium | Security posture is largely inherited from the hashids/hashids core and Laravel support versions. |
Key questions for the maintainer / vendor
Stack fit
Migration path
PublicIdEncoder with encode() / decode()). Nothing in the domain layer should reference the vendor namespace directly. This is the single highest-value decision here — it makes the package swappable and makes a future salt-rotation project tractable.Compatibility
1.3.*) with a scheduled review, rather than floating to ^1.0, until release hygiene improves.Sequencing
Sequence the salt and alphabet decision before any public identifier is issued. It is the one irreversible choice in the whole effort.
Maintenance
Support
PublicIdEncoder abstraction is what makes that a contained task rather than a rewrite.Scaling
Failure modes
| Failure mode | Blast radius | Detection & mitigation |
|---|---|---|
| Salt changed or lost | Every previously issued link breaks at once; irreversible | Secret-managed, backed up, access-controlled, and documented as a permanent contract. Test the decode path against a stored fixture. |
| Malformed / truncated token | Single request 404 or 500 instead of 404 | Never let the decoder throw into the HTTP layer; catch and translate to 404. Add negative tests. |
| Decoded ID does not exist | Enumeration probing of the ID space | Reversibility means an attacker can walk the space. Enforce authz on every lookup; rate-limit public endpoints; monitor 404 ratios. |
| Length drift after config edit | Silent truncation in UI or DB columns | Treat hash length as a contract; assert it in a test; alert on config diff. |
| Silent upstream patch introduces behavior change | Diffuse, hard to attribute | Pin versions; require a changelog before bumping; rely on round-trip property tests as the gate. |
| Package abandonment | Slow accumulation of unpatched risk | Wrapper abstraction keeps the exit cheap; review health signals annually. |
Ramp-up
TPM recommendation (provisional, pending the answers in Key Questions)
Adopt for public identifier obfuscation behind an internal abstraction, on a pinned version, with a secret-managed salt and a pre-agreed alphabet. Do not adopt as a security or authorization mechanism. Do not treat v1.3.1 as validated — it is a patch with no described contents, which is acceptable for a pin-and-review policy but is a standing release-hygiene concern worth raising with the maintainer before this becomes load-bearing. Overall risk for the intended use case is low-to-moderate, driven almost entirely by the salt contract and the project's thin maintenance signal rather than by anything in this release.
How can I help you explore Laravel packages today?