Skip to content

getUUID

获取uuid

配置项

参数类型是否必选默认值参数描述
-----

返回值

类型描述
UUIDuuid

示例

getUUID()

源码

js
export function getUUID () {
    return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
        (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
    );
}