HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
paralleldrive
cuid2
JavaScript2023–2026
paralleldrive / cuid2

cuid2

The most secure, collision-resistant ids optimized for horizontal scaling and performance.

12Distinct people
16Mentions
0Explicit recommenders
3.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The most secure, collision-resistant ids optimized for horizontal scaling and performance.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year16 dated mentions

Observed mentions: 2023-01-06 10:11:26 UTC to 2026-10-23 22:16:17 UTC.

024682023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 8 mentions; 3 submissions, 5 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 4 mentions; 2 submissions, 2 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC835
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC422
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC211
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

What Hacker News says

16 sources
If you really need monotonic, secure/unguessable IDs, there are options like CUID2 (github.com/paralleldrive/cuid2). Older designs like ULIDs (https://github.com/ulid/spec) and Snowflake IDs (https://en.wikipedia.org/wiki/Snowflake_ID) have similar properties to UUIDv7, and potentially some advantages w.r.t. length/encoding/runtime cost/etc. But UUIDv7 has one key advantage none of those do: you can store them in a UUID-typed column or struct field without any lossy conversion. All of the UUID versions share a common size and serialization format, so it doesn't actually matter if you generate v1/4/7/etc. Many language standard libraries can generate them interchangeably, and (for example) a Postgres table can store any of the versions in the same column type. So yes, to the author's point(s): they are not magic, monotonic, un-guessable ID
Read the rest
s and you shouldn't treat them as either "secure" or strictly ordered. That doesn't mean they aren't useful.
In UUIDv7: Timestamps aren’t time-ordered and other oddities
My understanding was that speed is not something you want in a UUID generator, since it makes it more susceptible to brute force attacks. Is this not the case? I've been using Cuid2[1] in most of my personal projects (this Go implementation[2], actually), which is fast enough, but not "too fast". It's also secure, collision resistant, and has everything I would need from a UUID. [1]: https://github.com/paralleldrive/cuid2 [2]: https://github.com/nrednav/cuid2
In Fast cryptographically safe GUID generator for Go
superjose·Sep 14, 2024Submission

Ask HN: ULID or CUID2 for B2B Startup?

I saw this after installing the Temporal.io client: https://github.com/paralleldrive/cuid2 What should I use for a startup going after B2B sales? ULIDs or CUID2s for primary keys? I remember seeing Hussein Nasser's Shopify video: https://www.youtube.com/watch?v=f53-Iw_5ucA And it made me switch to using ULIDs instead. I know this may fall into the "premature optimization is the root of all evils" category. But since it's straightforward, what should I do? I've been using ULIDs in distributed systems with no problems so far.
2 points · Open discussion
There's a comparison in the README of the project: https://github.com/paralleldrive/cuid2#the-contenders Some of the arguments mentioned are explained elsewhere in the README, others are assumed. One argument standing out for me is the lack of collision-resistance for UUIDv4 which is surprising for me and I didn't spot any sources for that argument. Another argument is the entropy source where they go about that Math.random is not reliable as a single entropy source but glimpsing at the source code, they sprinkle the CUID with Math.random data. I am no expert in ID security, so I am not qualified to speak about the validity of their arguments, only that there's insufficient information to validate without prior knowledge about the problem domain.
In Goodbye integers, hello UUIDv7
cuid [0] seems to be a random letter, concatenated with a sha3 hash of: - the system time - a process-global singleton counter (incrementing with each ID) - a "salt" derived from some number of bytes taken from an entropy source - a "fingerprint" of some number of bytes taken from the same entropy source this is an awful lot of work to be doing for each ID, to what end? well issue 7 [1] says that > Cuid2 is good when you need something secure, extremely collision resistant, and your system is distributed or decentralized (e.g. you want to be able to create records with ids on the client side), or you are building software that may need to scale horizontally). but I'm not sure how cuid as implemented provides a better answer in any of these dimensions to a plain old UUID maybe I'm just being cynical, I dunno [0] https://github.com/parallel
Read the rest
In You Don't Need UUID

Showing the 15 most recent of 16 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.