base\Security hashData()

hashData() public method

Prefixes data with a keyed hash value so that it can later be detected if it is tampered.

There is no need to hash inputs or outputs of encryptByKey() or encryptByPassword() as those methods perform the task.

See also:

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

The data to be protected

$key string

The secret key to be used for generating hash. Should be a secure cryptographic key.

$rawHash boolean

Whether the generated hash value is in raw binary format. If false, lowercase hex digits will be generated.

return string

The data prefixed with the keyed hash

throws yii\base\InvalidConfigException

when HMAC generation fails.

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

Please login to continue.