src/Drupal/Component/Utility/Number.php
public static function intToAlphadecimal($i = 0) {
    $num = base_convert((int) $i, 10, 36);
    $length = strlen($num);

    return chr($length + ord('0') - 1) . $num;
  }
public static function intToAlphadecimal($i = 0) {
    $num = base_convert((int) $i, 10, 36);
    $length = strlen($num);

    return chr($length + ord('0') - 1) . $num;
  }
public static function intToAlphadecimal ( $ i = 0 ) { $ num = base_convert ( ( int ) $ i , 10 , 36 ) ; $ length = strlen ( $ num ) ; return chr ( $ length + ord ( '0' ) - 1 ) . $ num ; }
Generates a sorting code from an integer.

Consists of a leading character indicating length, followed by N digits
with a numerical value in base 36 (alphadecimal). These codes can be sorted
as strings without altering numerical order.

It goes:
00, 01, 02, ..., 0y, 0z,
110, 111, ... , 1zy, 1zz,
2100, 2101, ..., 2zzy, 2zzz,
31000, 31001, ...

@param int $i
The integer value to convert.

@return string
The alpha decimal value.

@see \Drupal\Component\Utility\Number::alphadecimalToInt
Generates a sorting code from an integer .