src/index.js
function encode (nameOrCode, buf) {
  const base = getBase(nameOrCode)
  const name = base.name

  return multibase(name, Buffer.from(base.encode(buf)))
}
function encode (nameOrCode, buf) {
  const base = getBase(nameOrCode)
  const name = base.name

  return multibase(name, Buffer.from(base.encode(buf)))
}
function encode ( nameOrCode , buf ) { const base = getBase ( nameOrCode ) const name = base . name return multibase ( name , Buffer . from ( base . encode ( buf ) ) ) }
Encode data with the specified base and add the multibase prefix.

@param {string|number} nameOrCode - The multibase name or code number.
@param {Buffer} buf - The data to be encoded.
@returns {Buffer}
@memberof Multibase
Encode data with the specified base and add the multibase prefix .