Skip to content

Commit

Permalink
use random_bytes() instead of php-random-data wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jnorell committed Dec 23, 2021
1 parent 27ec668 commit 5ad5307
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
],
"minimum-stability": "stable",
"require": {
"php": ">=7.3",
"pedrosancao/php-random-data": "^1.0"
"php": ">=7.3"
},
"autoload": {
"psr-4": { "PedroSancao\\": "src/" }
Expand Down
3 changes: 1 addition & 2 deletions src/OTP/HOTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace PedroSancao\OTP;

use PedroSancao\Base32;
use PedroSancao\Random;

class HOTP
{
Expand Down Expand Up @@ -137,7 +136,7 @@ public static function create($secret = null, $size = 6)
public static function createRaw($secret = null, $size = 6)
{
if (is_null($secret)) {
$secret = Random::raw(15);
$secret = random_bytes(15);
}
return new static($secret, $size);
}
Expand Down

0 comments on commit 5ad5307

Please sign in to comment.