base\Security generateRandomKey()

generateRandomKey() public method

Generates specified number of random bytes.

Note that output may not be ASCII.

See also generateRandomString() if you need a string.

public string generateRandomKey ( $length = 32 )
$length integer

The number of bytes to generate

return string

The generated random bytes

throws yii\base\InvalidParamException

if wrong length is specified

throws yii\base\Exception

on failure.

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

Please login to continue.