mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
allow to select chars for randomString()
This commit is contained in:
parent
d9ba34d5b4
commit
85140018dd
1 changed files with 1 additions and 2 deletions
|
|
@ -177,9 +177,8 @@ function isValidSignature(string $signature, string $id, string $key, string $sa
|
|||
}
|
||||
|
||||
|
||||
function randomString(int $len = 16) : string
|
||||
function randomString(int $len = 16, string $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') : string
|
||||
{
|
||||
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
$a = [];
|
||||
$max = strlen($chars) - 1;
|
||||
for ($i = 0; $i < $len; $i++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue