( text: string, password: string, rounds: number = DEFAULT_ITER, saltHex = "" )
| 106 | }; |
| 107 | |
| 108 | export const encryptStringToBase32 = async ( |
| 109 | text: string, |
| 110 | password: string, |
| 111 | rounds: number = DEFAULT_ITER, |
| 112 | saltHex = "" |
| 113 | ) => { |
| 114 | const enc = await encryptArrayBuffer( |
| 115 | bufferToArrayBuffer(new TextEncoder().encode(text)), |
| 116 | password, |
| 117 | rounds, |
| 118 | saltHex |
| 119 | ); |
| 120 | return base32.stringify(new Uint8Array(enc), { pad: false }); |
| 121 | }; |
| 122 | |
| 123 | export const decryptBase32ToString = async ( |
| 124 | text: string, |
no test coverage detected