Files
mono/components/controller/src/utils/randomSha256.ts
T
2026-01-20 21:23:02 +05:00

7 lines
266 B
TypeScript

import { createHash, randomBytes } from 'node:crypto';
export function randomSHA256(): string {
const randomData = randomBytes(32).toString('hex'); // 32 байта случайных данных
return createHash('sha256').update(randomData).digest('hex');
}