UNPKG

509 BTypeScriptView Raw
1/**
2 * A function which creates a function that generates UUID v4 identifiers.
3 *
4 * @returns A new function that creates a UUID v4 string.
5 *
6 * #### Notes
7 * This implementation complies with RFC 4122.
8 *
9 * This uses `Random.getRandomValues()` for random bytes, which in
10 * turn will use the underlying `crypto` module of the platform if
11 * it is available. The fallback for randomness is `Math.random`.
12 */
13export declare function uuid4Factory(getRandomValues: (bytes: Uint8Array) => void): () => string;