16 lines
281 B
PHP
16 lines
281 B
PHP
<?php
|
|
|
|
if (! function_exists('hash_it')) {
|
|
function hash_it(int $key): string
|
|
{
|
|
return Hashids::encode($key);
|
|
}
|
|
}
|
|
|
|
if (! function_exists('unhash_it')) {
|
|
function unhash_it(string $hashid): int
|
|
{
|
|
return (int) Hashids::decode($hashid)[0];
|
|
}
|
|
}
|