string-to-array-buffer.js 223 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 export const stringToArrayBuffer = (string) => { const view = new Uint8Array(new ArrayBuffer(string.length)); for (let i = 0; i < string.length; i++) { view[i] = string.charCodeAt(i); } return view.buffer; };