Test Failed
Push — trunk ( e02d87...314b8c )
by SuperNova.WS
07:20
created

Crypto   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 32
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A signCheck() 0 2 1
A sign() 0 2 1
A hash() 0 2 1
A __construct() 0 2 1
1
<?php
2
/**
3
 * Created by Gorlum 13.02.2020 11:49
4
 */
5
6
namespace Core;
7
8
/**
9
 * Cryptography & signature-related tools
10
 *
11
 * @package Core
12
 */
13
class Crypto {
14
  /**
15
   * @var GlobalContainer $gc
16
   */
17
  protected $gc;
18
19
  public function __construct(GlobalContainer $gc) {
20
    $this->gc = $gc;
21
  }
22
23
  /**
24
   * @param string $string
25
   *
26
   * @return string
27
   */
28
  public function sign($string) {
29
    return $this->hash($string);
30
  }
31
32
  public function signCheck($string, $sign) {
33
    return $this->hash($string) === $sign;
34
  }
35
36
  /**
37
   * Used hash function
38
   *
39
   * @param $string
40
   *
41
   * @return string
42
   */
43
  public function hash($string) {
44
    return md5($string);
45
  }
46
47
}
48