public static function validateHash($data, $hash) {

        if(false === is_string($data) && false === is_numeric($data)) {
            return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or number, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
        }

        if(false === is_string($hash)) {
            return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($hash)), E_USER_ERROR);
        }

        return hash(self :: HASH_ALGORITHM, $data) === $hash;
    }
public static function validateHash($data, $hash) {

        if(false === is_string($data) && false === is_numeric($data)) {
            return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or number, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
        }

        if(false === is_string($hash)) {
            return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($hash)), E_USER_ERROR);
        }

        return hash(self :: HASH_ALGORITHM, $data) === $hash;
    }
public static function validateHash ( $ data , $ hash ) { if ( false === is_string ( $ data ) && false === is_numeric ( $ data ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string or number, "%s" given' , __METHOD__ , gettype ( $ data ) ) , E_USER_ERROR ) ; } if ( false === is_string ( $ hash ) ) { return trigger_error ( sprintf ( 'Argument 2 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ hash ) ) , E_USER_ERROR ) ; } return hash ( self :: HASH_ALGORITHM , $ data ) === $ hash ; }
Verifies that data matches a hash
@param string $data
@param string $hash
@return boolean
Verifies that data matches a hash