Skip to content

Function: generateUUID()

ts
function generateUUID(length?: number, radix?: number): string

生成UUID4

Example

ts
generateUUID();
generateUUID(12, 32);

Parameters

ParameterTypeDescription

length?

number

生成uuid的总长度,不传递则按照rfc4122标准生成uuid

radix?

number

uuid每个字符的基数 1-62

Returns

string

uuid字符串