flâneur — a map of the web's best reading

Moving away from UUIDs – Neil Madden

neilmadden.blog · 1,753 words · saved by 1 readers

If you need an unguessable random string (for a session cookie or access token, for example), it can be tempting to reach for a random UUID, which looks like this: 88cf3e49-e28e-4c0e-b95f-6a68a785a…

Moving away from UUIDs – Neil Madden Moving away from UUIDs If you need an unguessable random string (for a session cookie or access token, for example), it can be tempting to reach for a random UUID , which looks like this: 88cf3e49-e28e-4c0e-b95f-6a68a785a89d This is a 128-bit value formatted as 36 hexadecimal digits separated by hyphens. In Java and most other programming languages, these are very simple to generate: import java.util.UUID; String id = UUID.randomUUID().toString(); Under the hood this uses a cryptographically secure pseudorandom number generator (CSPRNG), so the IDs ge

Explore this link on the map →

related reading