code: function bufferToArrayBuffer(buf) {
    const arr = new ArrayBuffer(buf.length);
    const view = new Uint8Array(arr);
    for (let i = 0; i < buf.length; ++i) {
      view[i] = buf[i];
    }
    return arr;
  }
docs: Buffer -> ArrayBuffer
  @param {Buffer|Uint8Array} buf
  @returns {ArrayBuffer}