uuid.lol

Cuid is deprecated

Its author has retired it in favour of Cuid2. This page exists for systems that already contain Cuids. Do not pick it for something new.

Cuid Generator

Press c to copy or r for a new one

Generate in bulk

What is a Cuid?

A Cuid is a short string built by concatenating four fields in the clear: a millisecond timestamp, a counter of IDs made by this process, a fingerprint of the host, and some random characters.

Because the timestamp leads, Cuids sort lexicographically into creation order, which is what made them attractive as database keys.

Why it was deprecated

Everything a Cuid is made of is readable from the finished ID. The fingerprint identifies the machine, the timestamp identifies the moment, and the counter increments predictably.

An attacker holding one Cuid can therefore make good guesses about the next, which turns any ID doubling as a secret, such as a password reset link, into a real vulnerability. Cuid2 fixes this by hashing the inputs instead of printing them.

Generate one in code

TypeScript

import cuid from "cuid";

cuid();

Go

import "github.com/lucsky/cuid"

cuid.New()

Rust

// cargo add cuid

cuid::cuid1();