| 1 | <?php |
||
| 10 | class SecurityUtility |
||
| 11 | { |
||
| 12 | const DEFAULT_HASH_ALGORITHM = 'sha1'; |
||
| 13 | |||
| 14 | private $hashAlgorithm; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * generate a token. |
||
| 18 | * |
||
| 19 | * @throws \Exception |
||
| 20 | * |
||
| 21 | * @return string |
||
| 22 | */ |
||
| 23 | 3 | public function generateToken(): string |
|
| 27 | |||
| 28 | /** |
||
| 29 | * @param string $hashAlgorithm |
||
| 30 | * |
||
| 31 | * @throws \Exception |
||
| 32 | */ |
||
| 33 | 4 | public function setHashAlgorithm(string $hashAlgorithm) |
|
| 44 | |||
| 45 | /** |
||
| 46 | * @throws \Exception |
||
| 47 | * |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | 4 | public function getHashAlgorithm(): string |
|
| 58 | } |
||
| 59 |