fix(core): update

This commit is contained in:
Philipp Kunz 2020-03-05 20:41:15 +00:00
parent b2f0b8fc3d
commit 6a8fca75c9

View File

@ -18,8 +18,8 @@ export const uuid5 = (customStringArg: string, namespaceArg = plugins.uuid.v5.DN
return plugins.uuid.v5(customStringArg, namespaceArg);
};
export const uni = () => {
return 'unixxxxxxxxxxx'.replace(/[xy]/g, c => {
export const uni = (prefix: string = 'uni') => {
return `${prefix}xxxxxxxxxxx`.replace(/[xy]/g, c => {
const r = (Math.random() * 16) | 0;
const v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);