[DOC-CVS] [doc-en] master: Revert "Reverse hash_equals parameters (#4733)"

[email protected] (Tim Düsterhus)
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: Tim Düsterhus (TimWolla)
Date: 2025-06-20T01:06:48+02:00

Commit: https://github.com/php/doc-en/commit/6ba84e3a5b33eb27bae2f6df337c9a4305d11106
Raw diff: https://github.com/php/doc-en/commit/6ba84e3a5b33eb27bae2f6df337c9a4305d11106.diff

Revert "Reverse hash_equals parameters (#4733)"

see https://github.com/php/doc-en/pull/4733#issuecomment-2989328180

This reverts commit c769746c03d62089a5414f07b505cf24be068acc.

Changed paths:
  M  reference/hash/functions/hash-equals.xml


Diff:

diff --git a/reference/hash/functions/hash-equals.xml b/reference/hash/functions/hash-equals.xml
index 1ab4c7d6352a..eaf6836ebd16 100644
--- a/reference/hash/functions/hash-equals.xml
+++ b/reference/hash/functions/hash-equals.xml
@@ -76,7 +76,7 @@ $secretKey = '8uRhAeH89naXfFXKGOEj';
 $value = 'username=rasmuslerdorf';
 $signature = '8c35009d3b50caf7f5d2c1e031842e6b7823a1bb781d33c5237cd27b57b5f327';
 
-if (hash_equals($signature, hash_hmac('sha256', $value, $secretKey))) {
+if (hash_equals(hash_hmac('sha256', $value, $secretKey), $signature)) {
     echo "The value is correctly signed.", PHP_EOL;
 } else {
     echo "The value was tampered with.", PHP_EOL;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.