mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-17 18:17:42 +00:00
25 lines
407 B
PHP
25 lines
407 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace RobThree\Auth\Providers\Rng;
|
|
|
|
class CSRNGProvider implements IRNGProvider
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getRandomBytes(int $bytecount): string
|
|
{
|
|
return random_bytes($bytecount); // PHP7+
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function isCryptographicallySecure(): bool
|
|
{
|
|
return true;
|
|
}
|
|
}
|