public static function random(int $length) : string
{
static $chars = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$random = '';
for ($i = 1; $i <= $length; $i++) {
$random .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
}
return $random;
}