src/index.js
function decode (bufOrString) {
  if (Buffer.isBuffer(bufOrString)) {
    bufOrString = bufOrString.toString()
  }

  const code = bufOrString.substring(0, 1)
  bufOrString = bufOrString.substring(1, bufOrString.length)

  if (typeof bufOrString === 'string') {
    bufOrString = Buffer.from(bufOrString)
  }

  const base = getBase(code)
  return Buffer.from(base.decode(bufOrString.toString()))
}
function decode (bufOrString) {
  if (Buffer.isBuffer(bufOrString)) {
    bufOrString = bufOrString.toString()
  }

  const code = bufOrString.substring(0, 1)
  bufOrString = bufOrString.substring(1, bufOrString.length)

  if (typeof bufOrString === 'string') {
    bufOrString = Buffer.from(bufOrString)
  }

  const base = getBase(code)
  return Buffer.from(base.decode(bufOrString.toString()))
}
function decode ( bufOrString ) { if ( Buffer . isBuffer ( bufOrString ) ) { bufOrString = bufOrString . toString ( ) } const code = bufOrString . substring ( 0 , 1 ) bufOrString = bufOrString . substring ( 1 , bufOrString . length ) if ( typeof bufOrString === 'string' ) { bufOrString = Buffer . from ( bufOrString ) } const base = getBase ( code ) return Buffer . from ( base . decode ( bufOrString . toString ( ) ) ) }
Takes a buffer or string encoded with multibase header, decodes it and
returns the decoded buffer

@param {Buffer|string} bufOrString
@returns {Buffer}
@memberof Multibase
Takes a buffer or string encoded with multibase header decodes it and returns the decoded buffer