From d5438aaaab0340cf4085579bbfb0f2e95bebc159 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Thu, 29 Feb 2024 13:31:33 +0100 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/index.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) 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); + })}`; +};