← Back to release summary

crypto.randomUUID()

Category
Miscellaneous
Type
New or changed feature
Status
Enabled by default (Chrome 92)
Intent stage
Start incubating

Summary

Introduces the method crypto.randomUUID() for generating RFC 4122 version 4 identifiers. The method returns the namespace specific string representation (for example, "6e4decd0-6066-4a25-98e3-0227317cda52").

Motivation

Generating random UUIDs is a common need for web applications (the uuid module on npm is installed > 200,000,000 times a month). Developers who have not been exposed to RFC 4122 might naturally opt to invent their own approaches to UUID generation, potentially using insufficient PRNG implementations. Standardizing a UUID method, which dictates that a CSPRNG must be used, helps protect developers from security pitfalls.

Standards & signals

Explainers: https://github.com/WICG/uuid/blob/gh-pages/explainer.md

View on chromestatus.com