1 | <?php |
||
8 | class HashidsDriver implements DriverInterface |
||
9 | { |
||
10 | /** |
||
11 | * The Hashids instance. |
||
12 | * |
||
13 | * @var \Hashids\Hashids |
||
14 | */ |
||
15 | protected $hashids; |
||
16 | |||
17 | /** |
||
18 | * Create a new hashid driver instance. |
||
19 | * |
||
20 | * @param array $config |
||
21 | */ |
||
22 | 2 | public function __construct(array $config = []) |
|
30 | |||
31 | /** |
||
32 | * Encode the data. |
||
33 | * |
||
34 | * @param mixed $data |
||
35 | * @return string |
||
36 | */ |
||
37 | 1 | public function encode($data) |
|
38 | { |
||
39 | 1 | return $this->hashids->encode($data); |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * Decode the data. |
||
44 | * |
||
45 | * @param mixed $data |
||
46 | * @return mixed |
||
47 | */ |
||
48 | public function decode($data) |
||
52 | } |
||
53 |