1 | <?php |
||
10 | class Base10And62Converter |
||
11 | { |
||
12 | private const ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
||
13 | |||
14 | /** |
||
15 | * Converts base 10 [0-9] number to base 62 [0-9a-zA-Z]. |
||
16 | * |
||
17 | * @param int $number |
||
18 | * |
||
19 | * @return string |
||
20 | */ |
||
21 | 9 | public static function base10To62(int $number): string |
|
35 | |||
36 | /** |
||
37 | * Converts base 62 number [0-9a-zA-Z] to base 10 [0-9]. |
||
38 | * |
||
39 | * @param string $number |
||
40 | * |
||
41 | * @return int |
||
42 | */ |
||
43 | 8 | public static function base62To10(string $number): int |
|
54 | } |
||
55 |