| 1 | <?php |
||
| 14 | class Hash |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Hash Parameter. |
||
| 18 | * |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | private $hash; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Hash Length. |
||
| 25 | * |
||
| 26 | * @var int |
||
| 27 | */ |
||
| 28 | private $length; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return \Jose\Util\Hash |
||
| 32 | */ |
||
| 33 | public static function sha1() |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return \Jose\Util\Hash |
||
| 40 | */ |
||
| 41 | public static function sha256() |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @return \Jose\Util\Hash |
||
| 48 | */ |
||
| 49 | public static function sha384() |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return \Jose\Util\Hash |
||
| 56 | */ |
||
| 57 | public static function sha512() |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param string $hash |
||
| 64 | * @param int $length |
||
| 65 | */ |
||
| 66 | private function __construct($hash, $length) |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @return int |
||
| 74 | */ |
||
| 75 | public function getLength() |
||
| 79 | |||
| 80 | /** |
||
| 81 | * Compute the HMAC. |
||
| 82 | * |
||
| 83 | * @param string $text |
||
| 84 | * |
||
| 85 | * @return string |
||
| 86 | */ |
||
| 87 | public function hash($text) |
||
| 91 | } |
||
| 92 |