@@ -40,7 +40,7 @@ Returns a `Promise<CryptoKey>` containing a SHA-256 hash used to encrypt and dec
4040
4141A ` TypeError ` may be thrown if there are problems with the string key.
4242
43- ### ` encryptSymmetricallyText `
43+ ### ` encryptTextSymmetrically `
4444
4545Encrypts a value with a symmetric ` CryptoKey ` previously generated. It takes four parameters:
4646
@@ -53,7 +53,7 @@ Returns a `Promise<string>` containing the encrypted value.
5353
5454A ` DOMException ` may be thrown if the key is invalid or if the operation failed (e.g., AES-GCM plaintext longer than 2^39−256 bytes).
5555
56- ### ` decryptSymmetricallyText `
56+ ### ` decryptTextSymmetrically `
5757
5858Decrypts a value with a symmetric ` CryptoKey ` previously generated. It takes three parameters:
5959
@@ -79,8 +79,8 @@ This is a simple demonstration; production uses should utilize key rotation, amo
7979``` typescript
8080import {
8181 createSymmetricKeyWithText ,
82- encryptSymmetricallyText ,
83- decryptSymmetricallyText
82+ encryptTextSymmetrically ,
83+ decryptTextSymmetrically
8484} from " singlecrypt-text" ;
8585
8686import { getMessageEncryptionKey } from " ./lib/crypto/key" ;
@@ -92,14 +92,14 @@ const messageCryptoKey = await createSymmetricKeyWithText(
9292
9393
9494export async function encryptMessageId(value : string ) {
95- return await encryptSymmetricallyText (
95+ return await encryptTextSymmetrically (
9696 value ,
9797 messageCryptoKey
9898 );
9999}
100100
101101export async function decryptMessageId(value : string ) {
102- return await decryptSymmetricallyText (
102+ return await decryptTextSymmetrically (
103103 value ,
104104 messageCryptoKey
105105 );
@@ -111,8 +111,8 @@ Or you can reuse `TextEncoder` and `TextDecoder` instances for slightly better p
111111``` typescript
112112import {
113113 createSymmetricKeyWithText ,
114- encryptSymmetricallyText ,
115- decryptSymmetricallyText
114+ encryptTextSymmetrically ,
115+ decryptTextSymmetrically
116116} from " singlecrypt-text" ;
117117
118118import { getMessageEncryptionKey } from " ./lib/crypto/key" ;
@@ -127,15 +127,15 @@ const messageCryptoKey = await createSymmetricKeyWithText(
127127
128128
129129export async function encryptMessageId(value : string ) {
130- return await encryptSymmetricallyText (
130+ return await encryptTextSymmetrically (
131131 value ,
132132 messageCryptoKey ,
133133 textEncoder
134134 );
135135}
136136
137137export async function decryptMessageId(value : string ) {
138- return await decryptSymmetricallyText (
138+ return await decryptTextSymmetrically (
139139 value ,
140140 messageCryptoKey ,
141141 textDecoder
0 commit comments