From: Nicolas Boisselier Date: Wed, 14 Dec 2022 21:03:48 +0000 (+0100) Subject: random(): use random_bytes instead of mcrypt_create_iv X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=ac1cf7a6cf38b606fe5cb7d97dbe51586f89736b;p=nb.git random(): use random_bytes instead of mcrypt_create_iv --- diff --git a/lib/php/nb.php b/lib/php/nb.php index 3017bab8..5dc0b54b 100644 --- a/lib/php/nb.php +++ b/lib/php/nb.php @@ -903,7 +903,7 @@ class Nb { } public static function random_str($length=32) { - return bin2hex(mcrypt_create_iv($length/2, MCRYPT_DEV_URANDOM)); + return bin2hex(random_bytes($length/2)); } public static function encrypt($key,$value) {