diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 7f744ae..71ed7dd 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartunique', - version: '3.0.6', + version: '3.0.7', description: 'make things unique' } diff --git a/ts/index.ts b/ts/index.ts index 276b41d..be390fc 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -25,3 +25,11 @@ export const uni = (prefix: string = 'uni') => { return v.toString(16); })}`; }; + +export const uniSimple = (prefix: string = 'uni') => { + return `${prefix}${`xxxxxxxxxxxxxxxxxxxxxxxx`.replace(/[xy]/g, (c) => { + const r = (Math.random() * 16) | 0; + const v = c === 'x' ? r : (r & 0x3) | 0x8; + return v.toString(16); + })}`; +};