1 | <?php |
||
17 | class HashidsDriver implements HashDriver |
||
18 | { |
||
19 | /* ----------------------------------------------------------------- |
||
20 | | Properties |
||
21 | | ----------------------------------------------------------------- |
||
22 | */ |
||
23 | |||
24 | /** @var \Hashids\Hashids */ |
||
25 | private $hasher; |
||
26 | |||
27 | /* ----------------------------------------------------------------- |
||
28 | | Constructor |
||
29 | | ----------------------------------------------------------------- |
||
30 | */ |
||
31 | |||
32 | /** |
||
33 | * HashidsDriver constructor. |
||
34 | * |
||
35 | * @param array $options |
||
36 | */ |
||
37 | 72 | public function __construct(array $options) |
|
45 | |||
46 | /* ----------------------------------------------------------------- |
||
47 | | Main Methods |
||
48 | | ----------------------------------------------------------------- |
||
49 | */ |
||
50 | |||
51 | /** |
||
52 | * Encode the value. |
||
53 | * |
||
54 | * @param mixed $value |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | 24 | public function encode($value) |
|
62 | |||
63 | /** |
||
64 | * Decode the hashed value. |
||
65 | * |
||
66 | * @param string $hashed |
||
67 | * |
||
68 | * @return mixed |
||
69 | */ |
||
70 | 24 | public function decode($hashed) |
|
76 | } |
||
77 |