base\Security validateData()

validateData() public method

Validates if the given data is tampered.

See also hashData().

public string validateData ( $data, $key, $rawHash = false )
$data string

The data to be validated. The data must be previously generated by hashData().

$key string

The secret key that was previously used to generate the hash for the data in hashData(). function to see the supported hashing algorithms on your system. This must be the same as the value passed to hashData() when generating the hash for the data.

$rawHash boolean

This should take the same value as when you generate the data using hashData(). It indicates whether the hash value in the data is in binary format. If false, it means the hash value consists of lowercase hex digits only. hex digits will be generated.

return string

The real data with the hash stripped off. False if the data is tampered.

throws yii\base\InvalidConfigException

when HMAC generation fails.

doc_Yii
2016-10-30 16:52:22
Comments
Leave a Comment

Please login to continue.