code: public function encode($value, $b = 62)
      {
          $r = (int) $value % $b;
          $result = $this->base[$r];
          $q = floor((int) $value / $b);
  
          while ($q) {
              $r = $q % $b;
              $q = floor($q / $b);
              $result = $this->base[$r].$result;
          }
  
          return $result;
      }
docs: Encode an integer to a string.
  
  @param int $value
  @param int $b
  
  @return string