We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 096986a commit 6c3e22cCopy full SHA for 6c3e22c
1 file changed
lib/User.php
@@ -13,7 +13,7 @@ private static function generateTokenCode() {
13
}
14
15
private static function generateTokenHex() {
16
- return md5(random_bytes(32));
+ return bin2hex(random_bytes(16));
17
18
19
private static function generateExpiresTimestamp($lifetime) {
@@ -89,9 +89,9 @@ public static function createUser($newUser) {
89
if (!self::validatePasswordStrength($newUser['password'])) {
90
return false;
91
92
- $generatedUserId = md5(random_bytes(32));
+ $generatedUserId = bin2hex(random_bytes(16));
93
while (self::userIdExists($generatedUserId)) {
94
95
96
$query = Db::$pdo->prepare(
97
'INSERT INTO users VALUES (:userId, :email, :passwordHash, :data)'
0 commit comments