本文整理汇总了PHP中ESAPI::getEncryptor方法的典型用法代码示例。如果您正苦于以下问题:PHP ESAPI::getEncryptor方法的具体用法?PHP ESAPI::getEncryptor怎么用?PHP ESAPI::getEncryptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ESAPI
的用法示例。
在下文中一共展示了ESAPI::getEncryptor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hashPassword
/**
* Returns a $representation of the hashed password, using the
* accountName as the salt. The salt helps to prevent against "rainbow"
* table attacks where the attacker pre-calculates hashes for known strings.
* This method specifies the use of the user's account name as the "salt"
* value. The Encryptor.hash method can be used if a different salt is
* required.
*
* @param password
* the password to hash
* @param accountName
* the account name to use as the salt
*
* @return
* the hashed password
*/
function hashPassword($password, $accountName)
{
$salt = strtolower($accountName);
return ESAPI::getEncryptor()->hash($password, $salt);
}