Total Complexity | 4 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class HashCreator |
||
6 | { |
||
7 | private const CHARS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
||
8 | |||
9 | /** |
||
10 | * Generate a random string, using a cryptographically secure |
||
11 | * pseudorandom number generator (random_int). |
||
12 | * |
||
13 | * @param int $length How many characters do we want? |
||
14 | */ |
||
15 | public static function generate_hash(int $length = 64): string |
||
24 | } |
||
25 | |||
26 | public static function generate_hash_simple(int $length = 64): string |
||
29 | } |
||
30 | |||
31 | public static function create_hash_id(string $class, int $id): string |
||
38 |