From 304ba11ba52ffb6e12ccbc62d5a7da339226227d Mon Sep 17 00:00:00 2001 From: PhilReact Date: Mon, 14 Apr 2025 09:08:14 +0300 Subject: [PATCH] add identifier builder version --- src/utils/encryption.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/encryption.ts b/src/utils/encryption.ts index c680e4d..008ee04 100644 --- a/src/utils/encryption.ts +++ b/src/utils/encryption.ts @@ -7,6 +7,7 @@ import nacl from "../deps/nacl-fast"; import SHA256 from 'crypto-js/sha256'; import EncBase64 from 'crypto-js/enc-base64'; +export const IDENTIFIER_BUILDER_VERSION = `v1` export const requestQueueGetPublicKeys = new RequestQueueWithPromise(10); export enum EnumCollisionStrength { @@ -78,7 +79,7 @@ export async function hashWordWithoutPublicSalt( } -const uid = new ShortUniqueId({ length: 10, dictionary: "alphanum" }); +const uid = new ShortUniqueId({ length: 15, dictionary: "alphanum" }); interface EntityConfig { children?: Record; @@ -162,7 +163,7 @@ export async function buildIdentifier( ); } - return `${appHash}-${entityPrefix}-${parentRef}-${entityUid}`; + return `${appHash}-${entityPrefix}-${parentRef}-${entityUid}-${IDENTIFIER_BUILDER_VERSION}`; } export const createSymmetricKeyAndNonce = () => {