large commit

This commit is contained in:
Omair Saleh
2019-06-03 16:24:20 +08:00
parent c59535d991
commit 2aa9ddedde
3 changed files with 3 additions and 3 deletions
+2 -1
View File
@@ -9,8 +9,9 @@ final class common
/**
* @param int $length
* @return string
* @throws \Exception
*/
public static function generateRandomHash(int $length = 10): string {
return substr(bin2hex(ceil($length / 2)), 0, $length);
return substr(bin2hex(random_bytes(ceil($length / 2))), 0, $length);
}
}