function encode(nameOrCode, buf) {
        const enc = encoding(nameOrCode);
        const data = encodeText(enc.encode(buf));

        return concat([enc.codeBuf, data], enc.codeBuf.length + data.length);
      }
/**
       * Encode data with the specified base and add the multibase prefix.
       *
       * @param {BaseNameOrCode} nameOrCode - The multibase name or code number.
       * @param {Uint8Array} buf - The data to be encoded.
       * @returns {Uint8Array}
       * @throws {Error} Will throw if the encoding is not supported
       *
       */
Encode data with the specified base and add the multibase prefix.
@param {BaseNameOrCode} nameOrCode - The multibase name or code number.
@param {Uint8Array} buf - The data to be encoded.
@returns {Uint8Array}
@throws {Error} Will throw if the encoding is not supported
Encode data with the specified base and add the multibase prefix . @param { BaseNameOrCode } nameOrCode - The multibase name or code number . @param { Uint8Array } buf - The data to be encoded . @returns { Uint8Array } @throws { Error } Will throw if the encoding is not supported
function encode(nameOrCode, buf) {
        const enc = encoding(nameOrCode);
        const data = encodeText(enc.encode(buf));
        return concat([enc.codeBuf, data], enc.codeBuf.length + data.length);
      }
function encode ( nameOrCode , buf ) { const enc = encoding ( nameOrCode ) ; const data = encodeText ( enc . encode ( buf ) ) ; return concat ( [ enc . codeBuf , data ] , enc . codeBuf . length + data . length ) ; }
Encode data with the specified base and add the multibase prefix.
Encode data with the specified base and add the multibase prefix .