Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
RandomValidator.php
Go to the documentation of this file.
1
<?php
2
namespace
Ubiquity\security\csrf\generators
;
3
4
class
RandomValidator
implements
GeneratorInterface
{
5
6
public
function
generate
(?
string
$value =
null
): string {
7
$bytes = random_bytes((int) ($value ?? 32));
8
return \rtrim(\strtr(\base64_encode($bytes),
'+/'
,
'-_'
),
'='
);
9
}
10
}
11
Ubiquity\security\csrf\generators\RandomValidator
Definition
RandomValidator.php:4
Ubiquity\security\csrf\generators\RandomValidator\generate
generate(?string $value=null)
Definition
RandomValidator.php:6
Ubiquity\security\csrf\generators\GeneratorInterface
Definition
GeneratorInterface.php:4
Ubiquity\security\csrf\generators
Definition
GeneratorInterface.php:2
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity-security
src
Ubiquity
security
csrf
generators
RandomValidator.php
Generated on Sun Dec 10 2023 15:04:10 for
Ubiquity
by
doxygen
1.9.8