Completed
Push — master ( 31815e...08ec70 )
by Kai
04:34
created

Sha512Calculator::getHash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php namespace SimpleHash\Calculator;
2
3
/**
4
 * SHA512 Hash calculator class
5
 *
6
 * @package    SimpleHash
7
 * @author     Kai Hempel <[email protected]>
8
 * @copyright  2016 Kai Hempel <[email protected]>
9
 * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
10
 * @link       https://www.kuweh.de/
11
 * @since      Class available since Release 1.0.0
12
 */
13
class Sha512Calculator implements HashCalculatorInterface
14
{
15
    /**
16
     * Returns the SHA512 hash
17
     *
18
     * @param string $data
19
     * @return string
20
     */
21 2
    public function getHash($data)
22
    {
23 2
        return hash('sha512', $data);
24
    }
25
}
26