Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails

WCEmailTemplateAutoApplier::is_sha1_hashprivate staticWC 1.0

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() code WC 10.9.1

private static function is_sha1_hash( string $hash ): bool {
	return 40 === strlen( $hash ) && ctype_xdigit( $hash );
}