Otter@lemmy.ca to Programming@programming.devEnglish · 2 days ago8 versions of UUID and when to use themwww.ntietz.comexternal-linkmessage-square26fedilinkarrow-up196arrow-down12
arrow-up194arrow-down1external-link8 versions of UUID and when to use themwww.ntietz.comOtter@lemmy.ca to Programming@programming.devEnglish · 2 days agomessage-square26fedilink
minus-squareZikeji@programming.devlinkfedilinkEnglisharrow-up10arrow-down3·2 days agoReject UUID embrace ULID.
minus-squarebitfucker@programming.devlinkfedilinkarrow-up2·edit-22 days agoI prefer CUID Just to clarify: Yes, I do know not all use cases are appropriate for CUID. But in general when generating ID, I’d use CUID2
minus-squareGamma@beehaw.orglinkfedilinkEnglisharrow-up10·2 days agoInteresting 👀 https://github.com/ulid/spec
minus-square𝙲𝚑𝚊𝚒𝚛𝚖𝚊𝚗 𝙼𝚎𝚘𝚠@programming.devlinkfedilinkarrow-up8·2 days agoAt the company I work at we use UUIDv7 but base63 encoded I believe. This gives you fairly short ids (16 chars iirc, it includes lowercase letters) that are also sortable.
minus-squareshotgun_crab@lemmy.worldlinkfedilinkarrow-up1·2 days agoI’ll be borrowing that little trick
minus-square𝙲𝚑𝚊𝚒𝚛𝚖𝚊𝚗 𝙼𝚎𝚘𝚠@programming.devlinkfedilinkarrow-up1·2 days agohttps://github.com/TheArchitectDev/Architect.Identities Here’s the package one of our former developers created. It has some advantages and some drawbacks, but overall it’s been quite a treat to work with!
Reject UUID embrace ULID.
I prefer CUID
Just to clarify: Yes, I do know not all use cases are appropriate for CUID. But in general when generating ID, I’d use CUID2
Interesting 👀 https://github.com/ulid/spec
At the company I work at we use UUIDv7 but base63 encoded I believe. This gives you fairly short ids (16 chars iirc, it includes lowercase letters) that are also sortable.
I’ll be borrowing that little trick
https://github.com/TheArchitectDev/Architect.Identities
Here’s the package one of our former developers created. It has some advantages and some drawbacks, but overall it’s been quite a treat to work with!
I vote for nanoid.