hash_equals

hash_equals

(PHP 5 >= 5.6.0, PHP 7)

hash_equalsTiming attack safe string comparison

Description

bool hash_equals ( string $known_string , string $user_string )

Compares two strings using the same time whether they're equal or not.

This function should be used to mitigate timing attacks; for instance, when testing crypt() password hashes.

Parameters

known_stri