Skip to content

Commit

Permalink
removed mcrypt_create_iv func
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed Dec 22, 2019
1 parent 5423b4b commit 7352ac5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

// Create token
if(empty($_SESSION['token'])){
if(function_exists('mcrypt_create_iv')){
$_SESSION['token'] = bin2hex(mcrypt_create_iv(5, MCRYPT_DEV_URANDOM));
if(function_exists('random_bytes')){
$_SESSION['token'] = bin2hex(random_bytes(5));
} else {
$_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(5));
}
Expand Down

0 comments on commit 7352ac5

Please sign in to comment.