-
Notifications
You must be signed in to change notification settings - Fork 417
Expand file tree
/
Copy pathHashidsInterface.php
More file actions
33 lines (27 loc) · 803 Bytes
/
HashidsInterface.php
File metadata and controls
33 lines (27 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* Copyright (c) Ivan Akimov
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/vinkla/hashids
*/
namespace Hashids;
interface HashidsInterface
{
/**
* Encode parameters to generate a hash.
* @param int|string|array<int, int|string> ...$numbers
*/
public function encode(...$numbers): string;
/**
* Decode a hash to the original parameter values.
* @return array<int, int>
*/
public function decode(string $hash): array;
/** Encode hexadecimal values and generate a hash string. */
public function encodeHex(string $str): string;
/** Decode a hexadecimal hash. */
public function decodeHex(string $hash): string;
}