export default function toBuffer ( str ) { const buffer = new Uint8Array ( str . length ) ; for ( let i = 0 ; i < buffer . length ; i ++ ) { buffer [ i ] = str . charCodeAt ( i ) | 0 ; } return buffer ; }