public function decode($value, $b = 62)
    {
        $limit = strlen($value);
        $result = strpos($this->base, $value[0]);

        for ($i = 1; $i < $limit; $i++) {
            $result = $b * $result + strpos($this->base, $value[$i]);
        }

        return $result;
    }