Automattic\WooCommerce\Internal\Email\Unsubscribes

Endpoint::verifyprivate staticWC 1.0

Constant-time signature verification.

Method of the class: Endpoint{}

No Hooks.

Returns

bool.

Usage

$result = Endpoint::verify( $order_id, $hash, $kind, $signature ): bool;
$order_id(int) (required)
Order id from the URL.
$hash(string) (required)
Email hash from the URL (already shape-validated).
$kind(string) (required)
Kind from the URL (sanitized).
$signature(string) (required)
Signature from the URL.

Endpoint::verify() code WC 11.0.1

private static function verify( int $order_id, string $hash, string $kind, string $signature ): bool {
	$expected = self::sign( $order_id, $hash, $kind );
	return hash_equals( $expected, $signature );
}