@@ 18-22 (lines=5) @@ | ||
15 | public static function encrypt($plain, $algo = null) |
|
16 | { |
|
17 | if (!isset($algo) || ($algo == 'default') || ($algo == 'bcrypt')) { |
|
18 | if (!isset($algo) || ($algo == 'default')) { |
|
19 | $algo = PASSWORD_DEFAULT; |
|
20 | } else { |
|
21 | $algo = PASSWORD_BCRYPT; |
|
22 | } |
|
23 | ||
24 | return password_hash($plain, $algo); |
|
25 | } |
|
@@ 97-101 (lines=5) @@ | ||
94 | ||
95 | public static function needsRehash($hash, $algo = null) |
|
96 | { |
|
97 | if (!isset($algo) || ($algo == 'default')) { |
|
98 | $algo = PASSWORD_DEFAULT; |
|
99 | } elseif ($algo == 'bcrypt') { |
|
100 | $algo = PASSWORD_BCRYPT; |
|
101 | } |
|
102 | ||
103 | if (!is_int($algo)) { |
|
104 | trigger_error('OSC\OM\Hash::needsRehash() Algorithm "' . $algo . '" not supported.'); |