Short links that can't collide.
Snipx pulls the next integer from an atomic PostgreSQL sequence and encodes it through a bijective function. Every code maps to exactly one ID. No hashing, no lookups, no retry loops.
PostgreSQL sequence
-> 7_481_209
Sqids encode
-> "XbNkM3"
Short URL
unique · non-enumerable · reversible
the sequence is atomic at the database engine level. Sqids is a bijective function. Different integers never produce the same code.
Collision-free, by construction.
Most shorteners generate a random code, check if it exists, and retry on conflict. That works until you have enough links that collisions become frequent. Snipx skips the guessing entirely.
Why random codes break
With 6-character Base62 codes, you get ~56 billion possibilities. Sounds like plenty. But the Birthday Problem means collisions appear far sooner than intuition suggests: at just 100 million URLs, 83% of new codes will collide on the first try.
Atomic database counter
Every short link starts with a call to nextval('url_id_seq'). PostgreSQL guarantees that even under thousands of concurrent connections, each call returns a different number. No application-level locks. No optimistic concurrency. Just an integer that only goes up.
Bijective encoding
The raw integer is encoded through Sqids with a secret shuffled alphabet. The function is one-to-one: every integer maps to exactly one code, and every code maps back to exactly one integer. Uniqueness upstream guarantees uniqueness downstream. Codes are non-sequential and non-guessable.
Zero collision checks
Because the sequence only increments and Sqids is one-to-one, the INSERT can run without any prior SELECT to check for duplicates. There is no retry loop. The database schema does not even need a UNIQUE constraint on the short code for correctness (though one exists as a defensive measure).
Non-enumerable output
Sequential integers are predictable. If you know 42 exists, you know 43 probably does too. The Sqids encoding uses a secret shuffled alphabet that makes adjacent IDs produce unrelated codes. Knowing one valid code tells you nothing about the next.
Every redirect writes to the ledger.
When a visitor resolves a short link, Snipx increments the click counter in atomic storage. Log in to monitor resolution counts, manage link lifecycles, and inspect your full portfolio.
One POST. One short link.
Send a long URL, receive the encoded shortcode immediately. Optional Bearer auth links the record to your account for deletion and telemetry tracking.
The short code is generated at the moment of creation from the sequence. No pre-allocation and no post-validation. The response is final.
Questions
How does Snipx guarantee zero collisions?
Two properties combine. First, a PostgreSQL sequence hands out monotonically increasing integers. Each call to nextval() is atomic at the database engine level, so no two connections ever receive the same number. Second, Sqids is a bijective (one-to-one) function: different integers always produce different strings. If the inputs are unique, the outputs are unique. There is no randomness anywhere in the pipeline and no uniqueness check before the INSERT.
Can someone guess valid short codes?
Not practically. The Sqids encoding uses a secret shuffled alphabet that acts as an encryption key. Consecutive sequence numbers produce codes that appear completely unrelated. Knowing "XbNkM3" tells you nothing about which code came before or after it. The encoding is reversible, but only if you know the full 62-character alphabet.
What analytics does Snipx track?
Currently, Snipx tracks an aggregate click count per link. Every time a short code is resolved, the counter on that URL record gets incremented. You can view your click counts, creation dates, and destination URLs through the dashboard. Per-click event data (referrer, device, geography) is on the roadmap but not yet shipped.
Can I use Snipx without creating an account?
Yes. The URL creation endpoint accepts requests without authentication. If you include an auth token, the link gets tied to your account, so you can list, manage, and delete it later. Without a token, the link is still created and works for redirection, but it is not associated with any user.