@@ -32,7 +32,7 @@ class PasswordEncoder
32
32
const ALGORITHM_RIPEMD = 'RIPEMD ' ;
33
33
const ALGORITHM_RIPEMD_160 = 'RIPEMD-160 ' ;
34
34
const ALGORITHM_MAC = 'MAC ' ;
35
- const ALGORITHM_HMAC = 'HMAC ' ;
35
+ const ALGORITHM_HMAC = 'HMAC ' ;
36
36
37
37
/**
38
38
* Mapping between algorithm name and algorithm ID
@@ -41,17 +41,17 @@ class PasswordEncoder
41
41
* @see https://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.writeprotection.cryptographicalgorithmsid(v=office.14).aspx
42
42
*/
43
43
private static $ algorithmMapping = array (
44
- self ::ALGORITHM_MD2 => array (1 , 'md2 ' ),
45
- self ::ALGORITHM_MD4 => array (2 , 'md4 ' ),
46
- self ::ALGORITHM_MD5 => array (3 , 'md5 ' ),
47
- self ::ALGORITHM_SHA_1 => array (4 , 'sha1 ' ),
48
- self ::ALGORITHM_MAC => array (5 , '' ), // 'mac' -> not possible with hash()
49
- self ::ALGORITHM_RIPEMD => array (6 , 'ripemd ' ),
44
+ self ::ALGORITHM_MD2 => array (1 , 'md2 ' ),
45
+ self ::ALGORITHM_MD4 => array (2 , 'md4 ' ),
46
+ self ::ALGORITHM_MD5 => array (3 , 'md5 ' ),
47
+ self ::ALGORITHM_SHA_1 => array (4 , 'sha1 ' ),
48
+ self ::ALGORITHM_MAC => array (5 , '' ), // 'mac' -> not possible with hash()
49
+ self ::ALGORITHM_RIPEMD => array (6 , 'ripemd ' ),
50
50
self ::ALGORITHM_RIPEMD_160 => array (7 , 'ripemd160 ' ),
51
- self ::ALGORITHM_HMAC => array (9 , '' ), //'hmac' -> not possible with hash()
52
- self ::ALGORITHM_SHA_256 => array (12 , 'sha256 ' ),
53
- self ::ALGORITHM_SHA_384 => array (13 , 'sha384 ' ),
54
- self ::ALGORITHM_SHA_512 => array (14 , 'sha512 ' ),
51
+ self ::ALGORITHM_HMAC => array (9 , '' ), //'hmac' -> not possible with hash()
52
+ self ::ALGORITHM_SHA_256 => array (12 , 'sha256 ' ),
53
+ self ::ALGORITHM_SHA_384 => array (13 , 'sha384 ' ),
54
+ self ::ALGORITHM_SHA_512 => array (14 , 'sha512 ' ),
55
55
);
56
56
57
57
private static $ initialCodeArray = array (
@@ -99,10 +99,10 @@ class PasswordEncoder
99
99
* @param string $password
100
100
* @param string $algorithmName
101
101
* @param string $salt
102
- * @param integer $spinCount
102
+ * @param int $spinCount
103
103
* @return string
104
104
*/
105
- public static function hashPassword ($ password , $ algorithmName = PasswordEncoder ::ALGORITHM_SHA_1 , $ salt = null , $ spinCount = 10000 )
105
+ public static function hashPassword ($ password , $ algorithmName = self ::ALGORITHM_SHA_1 , $ salt = null , $ spinCount = 10000 )
106
106
{
107
107
$ origEncoding = mb_internal_encoding ();
108
108
mb_internal_encoding ('UTF-8 ' );
0 commit comments