param { string } str export function stringToArrayBuffer ( str ) { const buf = new ArrayBuffer ( str . length ) ; const view = new Uint8Array ( buf ) ; for ( let i = 0 ; i !== str . length ; ++ i ) { view [ i ] = str . charCodeAt ( i ) & 0xff ; } return buf ; }