Lección 3

UUID v4 and Randomness en español

Guía en español para uuid uuid v4 randomness: How v4 UUIDs use random bits and what collision risk really means.

Este contenido todavía no está disponible en español. Se muestra la versión en English mientras completamos la localización.

A UUID v4 contains random bits plus fixed version and variant bits. In practice, that leaves 122 random bits.

The collision risk is extremely low when generated with a good random source. The important condition is quality randomness: use platform cryptography APIs or trusted libraries, not Math.random().

UUID v4 is a good fit for:

  • Temporary local records
  • Database primary keys where random ordering is acceptable
  • Mock data and examples
  • Correlation IDs

If you need IDs that sort by creation time, look at UUID v7 or another ordered identifier scheme instead.

Volver al resumen del curso