NonceValidator

This commit is contained in:
sc0Vu 2017-12-14 23:12:44 +08:00
parent 5b47025afe
commit fdcb2a2d79

View 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);
}
}