Hash   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A RIPEMD160() 0 3 1
A SHA256() 0 3 1
A sha256d() 0 3 1
1
<?php
2
3
namespace mattvb91\TronTrx\Support;
4
5
/**
6
 * @codeCoverageIgnore
7
 */
8
class Hash
9
{
10
    public static function SHA256(string $data, $raw = true): string
11
    {
12
        return hash('sha256', $data, $raw);
13
    }
14
15
    public static function sha256d(string $data): string
16
    {
17
        return hash('sha256', hash('sha256', $data, true), true);
18
    }
19
20
    public static function RIPEMD160(string $data, $raw = true): string
21
    {
22
        return hash('ripemd160', $data, $raw);
23
    }
24
}