JS Built-ins
cryptointermediate

crypto β€” UUID contains dashes

πŸ“– Usage Example
const ids = new Set(Array.from({length: 1000}, () => crypto.randomUUID()))
ids.size  // β†’ 1000 (all unique)

UUIDs are statistically guaranteed to be unique.

crypto.randomUUID() β€” dash format

UUIDs are formatted with dashes at specific positions to separate groups of hex digits.

Challenge: Verify that a UUID string contains dash characters.

πŸ’‘ Hints (1)
  • β€’ A valid UUID has dashes at positions 8, 13, 18, and 23