feat(Random): add hex characters set

This commit is contained in:
Matthieu Bessat 2021-08-21 21:48:33 +02:00
parent 9eb428c528
commit df790e0c9a
3 changed files with 7 additions and 2 deletions

View file

@ -5,7 +5,8 @@ function generateRandomString($length = 10, $contains = ['upper', 'lower', 'digi
'digit' => '0123456789',
'lower' => 'abcdefghijklmnopqrstuvwxyz',
'upper' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'special' => '!#$%&()*+,-.:;<=>?@[]'
'special' => '!#$%&()*+,-.:;<=>?@[]',
'hex' => '0123456789abcdef'
];
$characters = '';
foreach ($contains as $c) {