@@ -97,15 +97,15 @@ const messageCryptoKey = await createSymmetricKeyFromText(
9797
9898export async function encryptMessage(text : string ) {
9999 return await encryptTextSymmetrically (
100- text ,
101- messageCryptoKey
100+ messageCryptoKey ,
101+ text
102102 );
103103}
104104
105105export async function decryptMessage(ciphertext : string ) {
106106 return await decryptTextSymmetrically (
107- ciphertext ,
108- messageCryptoKey
107+ messageCryptoKey ,
108+ ciphertext
109109 );
110110}
111111```
@@ -132,17 +132,17 @@ const messageCryptoKey = await createSymmetricKeyFromText(
132132
133133export async function encryptMessage(text : string ) {
134134 return await encryptTextSymmetrically (
135- text ,
136135 messageCryptoKey ,
136+ text ,
137137 true ,
138138 textEncoder
139139 );
140140}
141141
142142export async function decryptMessage(ciphertext : string ) {
143143 return await decryptTextSymmetrically (
144- ciphertext ,
145144 messageCryptoKey ,
145+ ciphertext ,
146146 textDecoder
147147 );
148148}
@@ -190,17 +190,23 @@ new SingleCryptText(
190190
191191#### Instance methods
192192
193- - ` async encrypt(text: string, urlSafe?: boolean, additionalData?: BufferSource): Promise<string> `
193+ ``` ts
194+ async encrypt (text : string , urlSafe ?: boolean , additionalData ?: BufferSource ): Promise < string >
195+ ```
194196
195- Encrypt a string using the instance's key. Optionally specify ` urlSafe ` (` true ` by default) to use ` base64url ` encoding.
197+ Encrypt a string using the instance's key. Optionally specify ` urlSafe ` (` true ` by default) to use ` base64url ` encoding.
196198
197- - ` async decrypt(ciphertext: string, additionalData?: BufferSource): Promise<string> `
199+ ``` ts
200+ async decrypt (ciphertext : string , additionalData ?: BufferSource ): Promise < string >
201+ ```
198202
199- Decrypt a string previously encrypted by this or any compatible instance.
203+ Decrypt a string previously encrypted by this or any compatible instance.
200204
201- - ` async getKey(): Promise<CryptoKey> `
205+ ``` ts
206+ async getKey (): Promise < CryptoKey >
207+ ```
202208
203- Returns the underlying ` CryptoKey ` instance.
209+ Returns the underlying ` CryptoKey ` instance.
204210
205211#### Example
206212
0 commit comments