Revert "fix: insecure randomness"
This commit is contained in:
1 parent
7275084ab9
commit
fa9a79192c
1 file changed
+1
-4
@@ -1,8 +1,5 @@
|
|||||||
import { randomBytes } from 'crypto';
|
|
||||||
|
|
||||||
export const generateUserId = () => {
|
export const generateUserId = () => {
|
||||||
const secureRandomString = randomBytes(8).toString('base36').substr(0, 9);
|
const userId = 'user_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);
|
||||||
const userId = 'user_' + Date.now() + '_' + secureRandomString;
|
|
||||||
|
|
||||||
return userId;
|
return userId;
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user