* Validates a hash to be a valid sha256 * @param string $hash the string to validate * @return Future that resolves as true if sha256 is valid */
(string $hash)
| 61 | * @return Future that resolves as true if sha256 is valid |
| 62 | */ |
| 63 | public static function IsValid(string $hash): Future |
| 64 | { |
| 65 | return async(function () use ($hash) { |
| 66 | if (preg_match("/^([a-f0-9]{64})$/", strtolower($hash)) == 1) { |
| 67 | return true; |
| 68 | } else { |
| 69 | return false; |
| 70 | } |
| 71 | }); |
| 72 | } |
| 73 | |
| 74 | |
| 75 | public function __toString(): string |
no outgoing calls