Skip to content
Permalink
Browse files

Change default value for Security::$hasType to 'sha1'.

Security::hash() defaulted to 'sha1' anyway.
  • Loading branch information...
ADmad committed Jul 6, 2014
1 parent 5c37808 commit 8c6b741220b29a85592f8fc1672d23126d842462
Showing with 5 additions and 7 deletions.
  1. +5 −7 src/Utility/Security.php
@@ -24,11 +24,11 @@
class Security {
/**
* Default hash method
* Default hash method. Default to 'sha1'.
*
* @var string
*/
public static $hashType = null;
public static $hashType = 'sha1';
/**
* Default cost
@@ -51,7 +51,7 @@ public static function generateAuthKey() {
*
* #### Using Blowfish
*
* - Creating Hashes: *Do not supply a salt*. Cake handles salt creation for
* - Creating Hashes: *Do not supply a salt*. CakePHP handles salt creation for
* you ensuring that each hashed password will have a *unique* salt.
* - Comparing Hashes: Simply pass the originally hashed password as the salt.
* The salt is prepended to the hash and php handles the parsing automagically.
@@ -64,8 +64,9 @@ public static function generateAuthKey() {
* }}}
*
* @param string $string String to hash
* @param string $type Hashing algo to use (i.e. md5, sha1, sha256 etc.).
* @param string $type Hashing algo to use (i.e. sha1, sha256, blowfish etc.).
* Can be any valid algo included in list returned by hash_algos() or 'blowfish'.
* If no value is passed the type specified by `Security::$hashType` is used.
* @param mixed $salt If true, automatically prepends the application's salt
* value to $string (Security.salt). If you are using blowfish the salt
* must be false or a previously generated salt.
@@ -76,9 +77,6 @@ public static function hash($string, $type = null, $salt = false) {
if (empty($type)) {
$type = static::$hashType;
}
if (empty($type)) {
$type = 'sha1';
}
$type = strtolower($type);
if ($type === 'blowfish') {

0 comments on commit 8c6b741

Please sign in to comment.
You can’t perform that action at this time.