packages/core/src/index.js
function bufferFromArrayBuffer(arrayBuffer) {
  const buffer = Buffer.alloc(arrayBuffer.byteLength);
  const view = new Uint8Array(arrayBuffer);

  for (let i = 0; i < buffer.length; ++i) {
    buffer[i] = view[i];
  }

  return buffer;
}
function bufferFromArrayBuffer(arrayBuffer) {
  const buffer = Buffer.alloc(arrayBuffer.byteLength);
  const view = new Uint8Array(arrayBuffer);

  for (let i = 0; i < buffer.length; ++i) {
    buffer[i] = view[i];
  }

  return buffer;
}
function bufferFromArrayBuffer ( arrayBuffer ) { const buffer = Buffer . alloc ( arrayBuffer . byteLength ) ; const view = new Uint8Array ( arrayBuffer ) ; for ( let i = 0 ; i < buffer . length ; ++ i ) { buffer [ i ] = view [ i ] ; } return buffer ; }
Prepare a Buffer object from the arrayBuffer. Necessary in the browser > node conversion, But this function is not useful when running in node directly
Prepare a Buffer object from the arrayBuffer . Necessary in the browser > node conversion But this function is not useful when running in node directly