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

Crypto::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
rs 10
c 1
b 0
f 0
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