public function decode(string $data): string
    {
        $this->validateInput($data);

        $data = str_split($data);
        $data = array_map(function ($character) {
            return strpos($this->options["characters"], $character);
        }, $data);

        $leadingZeroes = 0;
        while (!empty($data) && 0 === $data[0]) {
            $leadingZeroes++;
            array_shift($data);
        }

        $converted = $this->baseConvert($data, 62, 256);

        if (0 < $leadingZeroes) {
            $converted = array_merge(
                array_fill(0, $leadingZeroes, 0),
                $converted
            );
        }

        return implode("", array_map("chr", $converted));
    }
public function decode(string $data): string
    {
        $this->validateInput($data);

        $data = str_split($data);
        $data = array_map(function ($character) {
            return strpos($this->options["characters"], $character);
        }, $data);

        $leadingZeroes = 0;
        while (!empty($data) && 0 === $data[0]) {
            $leadingZeroes++;
            array_shift($data);
        }

        $converted = $this->baseConvert($data, 62, 256);

        if (0 < $leadingZeroes) {
            $converted = array_merge(
                array_fill(0, $leadingZeroes, 0),
                $converted
            );
        }

        return implode("", array_map("chr", $converted));
    }
public function decode ( string $ data ) : string { $ this -> validateInput ( $ data ) ; $ data = str_split ( $ data ) ; $ data = array_map ( function ( $ character ) { return strpos ( $ this -> options [ "characters" ] , $ character ) ; } , $ data ) ; $ leadingZeroes = 0 ; while ( ! empty ( $ data ) && 0 === $ data [ 0 ] ) { $ leadingZeroes ++ ; array_shift ( $ data ) ; } $ converted = $ this -> baseConvert ( $ data , 62 , 256 ) ; if ( 0 < $ leadingZeroes ) { $ converted = array_merge ( array_fill ( 0 , $ leadingZeroes , 0 ) , $ converted ) ; } return implode ( "" , array_map ( "chr" , $ converted ) ) ; }
Decode given a base62 string back to data
Decode given a base62 string back to data