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;
    }