From 088ae977eb11ac515dd521b06f43735d757d956d Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:13:38 +0330 Subject: [PATCH] Import source: backend/src/utils/crypto Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- backend/src/utils/crypto.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 backend/src/utils/crypto.ts diff --git a/backend/src/utils/crypto.ts b/backend/src/utils/crypto.ts new file mode 100644 index 0000000..43acf5e --- /dev/null +++ b/backend/src/utils/crypto.ts @@ -0,0 +1,14 @@ +import { createHash, randomBytes, randomUUID } from 'node:crypto'; + +export function randomId(bytes = 6) { + return randomBytes(bytes).toString('base64url'); +} + +export function newUuid() { + return randomUUID(); +} + +export function sha256(value: string) { + return createHash('sha256').update(value).digest('hex'); +} +