2
0
forked from jmug/cactoide

revert: fix: insecure randomness

This commit is contained in:
Levente Orban
2025-10-28 08:02:52 +01:00
committed by GitHub

View File

@@ -1,8 +1,5 @@
import { randomBytes } from 'crypto';
export const generateUserId = () => {
const secureRandomString = randomBytes(8).toString('base36').substr(0, 9);
const userId = 'user_' + Date.now() + '_' + secureRandomString;
const userId = 'user_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);
return userId;
};