public static function uid10(): string
    {
        $converted = base_convert(self::$hex_chars[random_int(0, 15)] . uniqid('', true) . self::$hex_chars[random_int(0, 15)], 16, 10);
        $res = '';

        for ($i = floor(log10((float)$converted) / 1.7923916894983); $i >= 0; --$i) {
            // Random index
            $j = 62 ** $i;
            $a = (int)floor($converted / $j);
            $res .= self::$alphanum_chars[$a];

            $converted -= $a * $j;
        }

        return sprintf('%010s', $res);
    }
public static function uid10(): string
    {
        $converted = base_convert(self::$hex_chars[random_int(0, 15)] . uniqid('', true) . self::$hex_chars[random_int(0, 15)], 16, 10);
        $res = '';

        for ($i = floor(log10((float)$converted) / 1.7923916894983); $i >= 0; --$i) {
            // Random index
            $j = 62 ** $i;
            $a = (int)floor($converted / $j);
            $res .= self::$alphanum_chars[$a];

            $converted -= $a * $j;
        }

        return sprintf('%010s', $res);
    }
public static function uid10 ( ) : string { $ converted = base_convert ( self :: $ hex_chars [ random_int ( 0 , 15 ) ] . uniqid ( '' , true ) . self :: $ hex_chars [ random_int ( 0 , 15 ) ] , 16 , 10 ) ; $ res = '' ; for ( $ i = floor ( log10 ( ( float ) $ converted ) / 1.7923916894983 ) ; $ i >= 0 ; -- $ i ) { // Random index $ j = 62 ** $ i ; $ a = ( int ) floor ( $ converted / $ j ) ; $ res .= self :: $ alphanum_chars [ $ a ] ; $ converted -= $ a * $ j ; } return sprintf ( '%010s' , $ res ) ; }
Generate simple random string, useful for hex names

@return string
Generate simple random string useful for hex names