param value export function encodeString ( value ) { return btoa ( value ) ; } param value export function encodeByteArray ( value ) { let str = "" ; for ( let i = 0 ; i < value . length ; i ++ ) { str += String . fromCharCode ( value [ i ] ) ; } return btoa ( str ) ; } param value export function decodeString ( value ) { const byteString = atob ( value ) ; const arr = new Uint8Array ( byteString . length ) ; for ( let i = 0 ; i < byteString . length ; i ++ ) { arr [ i ] = byteString . charCodeAt ( i ) ; } return arr ; }