GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

MD5   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hash() 0 6 2
A verify() 0 7 1
1
<?php
2
/**
3
 * MD5.php
4
 *
5
 * @category        AngryBytes
6
 * @package         Hash
7
 * @subpackage      Hasher
8
 * @copyright       Copyright (c) 2010 Angry Bytes BV (http://www.angrybytes.com)
9
 */
10
11
namespace AngryBytes\Hash\Hasher;
12
13
use AngryBytes\Hash\Hash;
14
use AngryBytes\Hash\HasherInterface;
15
16
/**
17
 * MD5 Hasher
18
 *
19
 * Generate and verify MD5 hashes.
20
 *
21
 * NOTE:
22
 *
23
 * This hasher MUST NOT be used for password storage. It is RECOMMENDED
24
 * to use the Hasher\Password for this purpose
25
 *
26
 * @see AngryBytes\Hasher\Password For a password hasher
27
 *
28
 * @category        AngryBytes
29
 * @package         Hash
30
 * @subpackage      Hasher
31
 */
32
class MD5 implements HasherInterface
33
{
34
    /**
35
     * {@inheritDoc}
36
     */
37
    public function hash($string, array $options = [])
38
    {
39
        $salt = isset($options['salt']) ? $options['salt'] : '';
40
41
        return md5($string . '-' . $salt);
42
    }
43
44
    /**
45
     * {@inheritDoc}
46
     *
47
     * @see Hash::compare()
48
     */
49
    public function verify($string, $hash, array $options = [])
50
    {
51
        return Hash::compare(
52
            $this->hash($string, $options),
53
            $hash
54
        );
55
    }
56
}
57