1 | <?php |
||
51 | class Hash extends \RandomLib\AbstractMixer |
||
52 | { |
||
53 | |||
54 | /** |
||
55 | * @var string The hash instance to use |
||
56 | */ |
||
57 | protected $hash = null; |
||
58 | |||
59 | /** |
||
60 | * Build the hash mixer |
||
61 | * |
||
62 | * @param string $hash The hash instance to use (defaults to sha512) |
||
63 | * |
||
64 | * @return void |
||
|
|||
65 | */ |
||
66 | public function __construct($hash = 'sha512') |
||
70 | |||
71 | /** |
||
72 | * Return an instance of Strength indicating the strength of the source |
||
73 | * |
||
74 | * @return \SecurityLib\Strength An instance of one of the strength classes |
||
75 | */ |
||
76 | public static function getStrength() |
||
80 | |||
81 | /** |
||
82 | * Test to see if the mixer is available |
||
83 | * |
||
84 | * @return bool If the mixer is available on the system |
||
85 | */ |
||
86 | public static function test() |
||
90 | |||
91 | /** |
||
92 | * Get the block size (the size of the individual blocks used for the mixing) |
||
93 | * |
||
94 | * @return int The block size |
||
95 | */ |
||
96 | protected function getPartSize() |
||
100 | |||
101 | /** |
||
102 | * Mix 2 parts together using one method |
||
103 | * |
||
104 | * @param string $part1 The first part to mix |
||
105 | * @param string $part2 The second part to mix |
||
106 | * |
||
107 | * @return string The mixed data |
||
108 | */ |
||
109 | protected function mixParts1($part1, $part2) |
||
113 | |||
114 | /** |
||
115 | * Mix 2 parts together using another different method |
||
116 | * |
||
117 | * @param string $part1 The first part to mix |
||
118 | * @param string $part2 The second part to mix |
||
119 | * |
||
120 | * @return string The mixed data |
||
121 | */ |
||
122 | protected function mixParts2($part1, $part2) |
||
126 | } |
||
127 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.