Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails
WCEmailTemplateAutoApplier::is_sha1_hash
Validate that a string is shaped like a SHA-1 hex digest.
Method of the class: WCEmailTemplateAutoApplier{}
No Hooks.
Returns
true|false. True when the value is a 40-character hex string.
Usage
$result = WCEmailTemplateAutoApplier::is_sha1_hash( $hash ): bool;
- $hash(string) (required)
- Candidate hash value.
WCEmailTemplateAutoApplier::is_sha1_hash() WCEmailTemplateAutoApplier::is sha1 hash code WC 10.9.1
private static function is_sha1_hash( string $hash ): bool {
return 40 === strlen( $hash ) && ctype_xdigit( $hash );
}