W3cubDocs

/Symfony 2.7

Symfony\Component\Security\Core\Util\SecureRandom

class SecureRandom implements SecureRandomInterface

A secure random number generator implementation.

Methods

__construct(string $seedFile = null, LoggerInterface $logger = null)

Constructor.

string nextBytes(integer $nbBytes)

Generates the specified number of secure random bytes.

Details

public __construct(string $seedFile = null, LoggerInterface $logger = null)

Constructor.

Be aware that a guessable seed will severely compromise the PRNG algorithm that is employed.

Parameters

string $seedFile
LoggerInterface $logger

public string nextBytes(integer $nbBytes)

Generates the specified number of secure random bytes.

Parameters

integer $nbBytes

Return Value

string

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Security/Core/Util/SecureRandom.html