( text: string, password: string, rounds: number = DEFAULT_ITER, saltHex = "" )
| 135 | }; |
| 136 | |
| 137 | export const encryptStringToBase64url = async ( |
| 138 | text: string, |
| 139 | password: string, |
| 140 | rounds: number = DEFAULT_ITER, |
| 141 | saltHex = "" |
| 142 | ) => { |
| 143 | const enc = await encryptArrayBuffer( |
| 144 | bufferToArrayBuffer(new TextEncoder().encode(text)), |
| 145 | password, |
| 146 | rounds, |
| 147 | saltHex |
| 148 | ); |
| 149 | return base64url.stringify(new Uint8Array(enc), { pad: false }); |
| 150 | }; |
| 151 | |
| 152 | export const decryptBase64urlToString = async ( |
| 153 | text: string, |
no test coverage detected