function decode(data) {
        if (data instanceof Uint8Array) {
          data = decodeText(data);
        }
        const prefix = data[0];

        // Make all encodings case-insensitive except the ones that include upper and lower chars in the alphabet
        if (
          [
            "f",
            "F",
            "v",
            "V",
            "t",
            "T",
            "b",
            "B",
            "c",
            "C",
            "h",
            "k",
            "K",
          ].includes(prefix)
        ) {
          data = data.toLowerCase();
        }
        const enc = encoding(/** @type {BaseCode} */ (data[0]));
        return enc.decode(data.substring(1));
      }
/**
       * Takes a Uint8Array or string encoded with multibase header, decodes it and
       * returns the decoded buffer
       *
       * @param {Uint8Array|string} data
       * @returns {Uint8Array}
       * @throws {Error} Will throw if the encoding is not supported
       *
       */
Takes a Uint8Array or string encoded with multibase header, decodes it and
returns the decoded buffer

@param {Uint8Array|string} data
@returns {Uint8Array}
@throws {Error} Will throw if the encoding is not supported
Takes a Uint8Array or string encoded with multibase header decodes it and returns the decoded buffer @param { Uint8Array|string } data @returns { Uint8Array } @throws { Error } Will throw if the encoding is not supported
function decode(data) {
        if (data instanceof Uint8Array) {
          data = decodeText(data);
        }
        const prefix = data[0];
        if (
          [
            "f",
            "F",
            "v",
            "V",
            "t",
            "T",
            "b",
            "B",
            "c",
            "C",
            "h",
            "k",
            "K",
          ].includes(prefix)
        ) {
          data = data.toLowerCase();
        }
        const enc = encoding( (data[0]));
        return enc.decode(data.substring(1));
      }
function decode ( data ) { if ( data instanceof Uint8Array ) { data = decodeText ( data ) ; } const prefix = data [ 0 ] ; if ( [ "f" , "F" , "v" , "V" , "t" , "T" , "b" , "B" , "c" , "C" , "h" , "k" , "K" , ] . includes ( prefix ) ) { data = data . toLowerCase ( ) ; } const enc = encoding ( ( data [ 0 ] ) ) ; return enc . decode ( data . substring ( 1 ) ) ; }
Takes a Uint8Array or string encoded with multibase header, decodes it and
 returns the decoded buffer
Takes a Uint8Array or string encoded with multibase header decodes it and returns the decoded buffer
// Make all encodings case-insensitive except the ones that include upper and lower chars in the alphabet /** @type {BaseCode} */