code: function toArrayLike(buf) {
    if (buf instanceof Uint8Array) {
      return buf;
    } else if (buf instanceof ArrayBuffer) {
      return new Uint8Array(buf);
    } else if (Buffer.isBuffer(buf)) {
      return buf;
    } else {
      return buf; // type unknown, trust the user
    }
  }
docs: Convert any buffer to array-like type: Uint8Array|Buffer
  @param {Buffer|ArrayBuffer|Uint8Array} buf
  @returns {Buffer|Uint8Array}