mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-14 15:56:48 +03:00
Use a high-strength generator by default, when using RandomLibAdapter
This commit is contained in:
@@ -33,7 +33,7 @@ class RandomLibAdapter implements RandomGeneratorInterface
|
||||
/**
|
||||
* Constructs a `RandomLibAdapter` using a `RandomLib\Generator`
|
||||
*
|
||||
* By default, if no `Generator` is passed in, this creates a medium-strength
|
||||
* By default, if no `Generator` is passed in, this creates a high-strength
|
||||
* generator to use when generating random binary data.
|
||||
*
|
||||
* @param Generator $generator An paragonie/random-lib `Generator`
|
||||
@@ -45,7 +45,7 @@ class RandomLibAdapter implements RandomGeneratorInterface
|
||||
if ($this->generator === null) {
|
||||
$factory = new Factory();
|
||||
|
||||
$this->generator = $factory->getMediumStrengthGenerator();
|
||||
$this->generator = $factory->getHighStrengthGenerator();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class RandomLibAdapterTest extends TestCase
|
||||
public function testAdapterWithGeneratorDoesNotCreateGenerator()
|
||||
{
|
||||
$factory = Mockery::mock('overload:RandomLib\Factory');
|
||||
$factory->shouldNotReceive('getMediumStrengthGenerator')
|
||||
$factory->shouldNotReceive('getHighStrengthGenerator')
|
||||
->getMock();
|
||||
|
||||
$generator = $this->getMockBuilder('RandomLib\Generator')
|
||||
@@ -36,7 +36,7 @@ class RandomLibAdapterTest extends TestCase
|
||||
public function testAdapterWithoutGeneratorGreatesGenerator()
|
||||
{
|
||||
$factory = Mockery::mock('overload:RandomLib\Factory');
|
||||
$factory->shouldReceive('getMediumStrengthGenerator')
|
||||
$factory->shouldReceive('getHighStrengthGenerator')
|
||||
->once()
|
||||
->getMock();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user