MCPcopy Create free account
hub / github.com/GDATASoftwareAG/vaas / IsValid

Method IsValid

php/src/vaas/Sha256.php:63–72  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Calls

no outgoing calls