private function decode($seed, $format = null)
    {
        $encoder = new RawEncoder();

        // Auto-detect
        if ($format === null) {
            if (preg_match('/^[0-9a-f]+$/i', $seed)) {
                $encoder = new HexEncoder();
            } elseif (preg_match('/^[2-7a-z]+$/i', $seed)) {
                $encoder = new Base32Encoder();
            }
        // User-specified
        } else {
            if ($format == self::FORMAT_HEX) {
                $encoder = new HexEncoder();
            } elseif ($format == self::FORMAT_BASE32) {
                $encoder = new Base32Encoder();
            }
        }

        $output = $encoder->decode($seed);

        return $output;
    }