Import source: backend/src/utils/crypto

Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
arsam
2026-09-18 23:13:38 +03:30
parent abc8ef218c
commit 088ae977eb
+14
View File
@@ -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');
}