0.0.1 • Published 8 months ago
typid v0.0.1
typid
Simple Stripe like IDs, non sortable. Defaults to 80 bits of randomness^1 (12-14 characters).
import typid from "typid";
const id = typid("user");
// => user_5ozBxXrc2vRXiQ
const privateKey = typid("pk", 128);
^1(https://math.stackexchange.com/a/2398739/3965), it takes around 22 trillion generated IDs to get a duplicate.
0.0.1
8 months ago