Passed
Push — master ( ad2baf...e1d221 )
by Florian
01:09
created

Sha1PasswordHasher   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 2
dl 0
loc 12
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A callHashFunction() 0 3 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Copyright (c) Phauthentic (https://github.com/Phauthentic)
5
 *
6
 * Licensed under The MIT License
7
 * For full copyright and license information, please see the LICENSE.txt
8
 * Redistributions of files must retain the above copyright notice.
9
 *
10
 * @copyright     Copyright (c) Phauthentic (https://github.com/Phauthentic)
11
 * @link          https://github.com/Phauthentic
12
 * @license       https://opensource.org/licenses/mit-license.php MIT License
13
 */
14
namespace Phauthentic\PasswordHasher;
15
16
/**
17
 * Sha1 Password Hasher
18
 *
19
 * WARNING: This is UNSAFE and should NOT be used anymore!!! sha1 has been
20
 * compromised! It is no longer a secure hash algorythm!
21
 *
22
 * This hasher just exists for legacy reasons and is thought to be used with
23
 * the Fallback hasher, to update the passwords transparently to a secure hash.
24
 *
25
 * @link http://php.net/manual/en/function.sha1.php
26
 */
27
class Sha1PasswordHasher extends Md5PasswordHasher
28
{
29
    /**
30
     * Calls the actual php method that will do the hashing
31
     *
32
     * @link http://php.net/manual/en/function.sha1.php
33
     * @param string $password Password string
34
     * @return string
35
     */
36 2
    protected function callHashFunction($password): string
37
    {
38 2
        return sha1($password, $this->rawOutput);
39
    }
40
}
41