RandomLib
RandomLib copied to clipboard
Is the new Random\Randomizer::getBytesFromString a replacement for this lib?
Hello, I've been using this library for some years, and recently I noticed that PHP just added a getBytesFromString function. So I was wondering if I could replace the usage of this library with that new native implementation.
Example of old code:
<?php
$factory = new RandomLib\Factory;
$generator = $factory->getMediumStrengthGenerator();
$randomString = $generator->generateString(8, 'abcdefghijklmnopqrstuvwxyz0123456789');
example of possible replacement:
<?php
$randomizer = new \Random\Randomizer();
$randomString = $randomizer->getBytesFromString('abcdefghijklmnopqrstuvwxyz0123456789', 8);
If so, what would be the matching strength of the generator?