NonceValidator
This commit is contained in:
parent
5b47025afe
commit
fdcb2a2d79
22
src/Validators/NonceValidator.php
Normal file
22
src/Validators/NonceValidator.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Web3\Validators;
|
||||||
|
|
||||||
|
use Web3\Validators\IValidator;
|
||||||
|
|
||||||
|
class NonceValidator
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* validate
|
||||||
|
*
|
||||||
|
* @param string $value
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function validate($value)
|
||||||
|
{
|
||||||
|
if (!is_string($value)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return (preg_match('/^0x[a-fA-F0-9]{16}$/', $value) >= 1);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user