@storm-stack/unique-identifier
Version:
This package provides a simple way to generate various types of unique identifiers.
19 lines (18 loc) • 587 B
TypeScript
/**
* A utility function that returns a [UUID (Universally Unique Identifier)](https://www.cockroachlabs.com/blog/what-is-a-uuid/) string.
*
* @remarks
* This function generates a random UUID (Universally Unique Identifier) using a cryptographically secure pseudo-random number generator.
*
* This implementation was based on https://github.com/lukeed/uuid.
*
* @example
* ```typescript
* // Generate a UUID string
* const id = uuid();
* // => "f47ac10b-58cc-4372-a567-0e02b2c3d479"
* ```
*
* @returns A UUID unique identifier.
*/
export declare function uuid(): string;