PHP | hash_equals() Function Last Updated : 04 Mar, 2021 Comments Improve Suggest changes Like Article Like Report The hash_equals function() is an inbuilt function in PHP which is used to compares two strings using the same time whether they are equal or not.Syntax: hash_equals( $known_str, $usr_str ) Parameters: This function accept two parameters as mention above and describe below. $known_str: This parameter is used to specify the known length string.$usr_str: This parameter is used to specify the user-supplied string. Return Value: This function returns True if both strings are equal, False otherwise.Below programs illustrate the hash_equals() function in PHP:Program 1: php <?php // PHP program to illustrate // hash_equals function $known_str = crypt('GFG', 'Hello-GFG'); $usr_str = crypt('GFG', 'Hello-GFG'); // Compare both strings $res = hash_equals($known_str, $usr_str); // Display result var_dump($res); ?> Output: bool(true) Program 2: php <?php // PHP program to illustrate // hash_equals function $known_str = crypt('GFG', 'Hello-GFG'); $usr_str = crypt('GeeksforGeeks', 'Hello-GFG'); // Compare both strings $res = hash_equals($known_str, $usr_str); // Display result var_dump($res); ?> Output: bool(false) Reference: http://php.net/manual/en/function.hash-equals.php Comment More infoAdvertise with us Next Article PHP | hash_equals() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP Hash PHP-function Practice Tags : Hash Similar Reads PHP | hash_algos() Function The hash_algos() function is an inbuilt function in PHP which is used to return a list of registered hashing algorithms. Syntax: array hash_algos( void ) Parameter: This function does not accepts any parameter. Return Value: This function returns a numerically indexed array which contains the list o 2 min read PHP | hash_final() Function The hash_final() function is an inbuilt function in PHP which is used to finalize an incremental hash and return the resulting digest. Syntax: hash_final( $context, $raw_output ) Parameters: This function accept two parameters as mention above and describe below. $context: This parameter is used to 1 min read PHP | hash_file( ) Function The hash_file() function is an inbuilt function in PHP which is used to generate a hash value using the contents of a given file. Syntax: string hash_file( $algo, $file, $raw_opt ) Parameters: This function accept three parameters as mention above and describe below. $algo: It is the required parame 2 min read PHP | hash_hmac_algos() Function The hash_hmac_algos() function is an inbuilt function in PHP that is used to get the list of registered hashing algorithms suitable for the hash_hmac() function. Syntax: array hash_hmac_algos( void ) Parameters: This function does not accept any parameter. Return Value: This function returns an ar 2 min read PHP | hash_copy() Function The hash_copy() function is an inbuilt function in PHP which is used to get the copy of hashing context. Syntax: hash_copy( $context ) Parameters: This function accepts single parameter $context which is used to specify the hashing context returned by hash_init() function. Return Value: This functio 1 min read PHP | hash_hmac_file() Function The hash_hmac_file() function is an inbuilt function in PHP that is used to generate a keyed hash value using the contents of a given file. Syntax: string hash_hmac_file( $algo, $file, $key, $raw_opt ) Parameters: This function accepts four parameters as mentioned above and described below. $algo: 2 min read PHP password_algos() Function The password_algos() is an inbuilt function in PHP that returns the Ids which get available by the password hashing algorithm. Here, Id represents the array of strings. Syntax: password_algos(): arrayParameter: This function does not accept any parameter. Return Value: This function returns an array 1 min read PHP | IntlCalendar equals() Function The IntlCalendar::equals() function is an inbuilt function in PHP which is used to compare two IntlCalendar time objects and returns true if this calendar and given calendar have same date otherwise returns false. Syntax: Object oriented style: bool IntlCalendar::equals( IntlCalendar $other ) Proced 2 min read PHP | hash_hmac() Function The hash_hmac() function is an inbuilt function in PHP which is used to generate the keyed hash value using the HMAC method. Syntax: string hash_hmac( $algo, $msg, $key, $raw_opt ) Parameters: This function accepts four parameters as mention above and describe below. $algo: It is the required parame 2 min read PHP | each() Function The each() function is an inbuilt function in PHP which basically returns an array with four elements, two elements (1 and Value) for the element value, and two elements (0 and Key) for the element key and moves the cursor forward. Syntax: each(array) Parameters: Array: It specifies the array which 2 min read Like