1 | <?php |
||
8 | class UrlSafeCipher extends Cipher |
||
9 | { |
||
10 | /** |
||
11 | * Encrypt the given value so that it's unreadable and that it can be used in an url. |
||
12 | * |
||
13 | * @param string $value |
||
14 | * @param bool $raw_binary |
||
15 | * |
||
16 | * @return string |
||
17 | * |
||
18 | * @throws \Defuse\Crypto\Exception\EnvironmentIsBrokenException |
||
19 | */ |
||
20 | 1 | public function encrypt($value, $raw_binary = false) |
|
24 | |||
25 | /** |
||
26 | * Decrypt the given value so that it's readable again. |
||
27 | * |
||
28 | * @param string $value |
||
29 | * @param bool $raw_binary |
||
30 | * |
||
31 | * @return string |
||
32 | * |
||
33 | * @throws \Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException |
||
34 | * @throws \Defuse\Crypto\Exception\EnvironmentIsBrokenException |
||
35 | */ |
||
36 | 2 | public function decrypt($value, $raw_binary = false) |
|
51 | |||
52 | /** |
||
53 | * Decodes a hexadecimal encoded binary string. |
||
54 | * PHP version >= 5.4 has a function for this by default. |
||
55 | * |
||
56 | * @deprecated The "Kunstmaan\UtilitiesBundle\Helper\Cipher\UrlSafeCipher::hex2bin" method is deprecated since KunstmaanUtilitiesBundle 5.5 and will be removed in KunstmaanUtilitiesBundle 6.0. |
||
57 | * |
||
58 | * @param string $hexString |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | 2 | public function hex2bin($hexString) |
|
80 | } |
||
81 |
If you suppress an error, we recommend checking for the error condition explicitly: