mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-10-18 09:45:31 +00:00
d1792f07d1
and remove the openssl provider. We now rely exclusively on random_bytes(), as there are no reasons not to. Fix #121
29 lines
492 B
PHP
29 lines
492 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Providers\Rng;
|
|
|
|
use RobThree\Auth\Providers\Rng\IRNGProvider;
|
|
|
|
class TestRNGProvider implements IRNGProvider
|
|
{
|
|
public function __construct(private readonly bool $isSecure = false)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getRandomBytes(int $bytecount): string
|
|
{
|
|
$result = '';
|
|
|
|
for ($i = 0; $i < $bytecount; $i++) {
|
|
$result .= chr($i);
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
}
|