Skip to content

Commit 28aeb6c

Browse files
Chore/minor-improvements (#5)
* docs: improved jest doc section * chore: minor doc improvements * bump: updated `@types/node` to `22.10.7`
1 parent e089873 commit 28aeb6c

File tree

3 files changed

+69
-71
lines changed

3 files changed

+69
-71
lines changed

README.md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pnpm i @alessiofrittoli/crypto-cipher
8989

9090
#### Constants
9191

92-
##### `SALT_LENGTH`
92+
##### `Cipher.SALT_LENGTH`
9393

9494
Defines the minimum, maximum, and default lengths for salt.
9595

@@ -106,7 +106,7 @@ Defines the minimum, maximum, and default lengths for salt.
106106

107107
---
108108

109-
##### `IV_LENGTH`
109+
##### `Cipher.IV_LENGTH`
110110

111111
Defines the minimum, maximum, and default lengths for initialization vectors (IV).
112112

@@ -123,7 +123,7 @@ Defines the minimum, maximum, and default lengths for initialization vectors (IV
123123

124124
---
125125

126-
##### `AUTH_TAG_LENGTH`
126+
##### `Cipher.AUTH_TAG_LENGTH`
127127

128128
Defines the minimum, maximum, and default lengths for authentication tags.
129129

@@ -140,7 +140,7 @@ Defines the minimum, maximum, and default lengths for authentication tags.
140140

141141
---
142142

143-
##### `AAD_LENGTH`
143+
##### `Cipher.AAD_LENGTH`
144144

145145
Defines the minimum, maximum, and default lengths for additional authenticated data (AAD).
146146

@@ -157,23 +157,23 @@ Defines the minimum, maximum, and default lengths for additional authenticated d
157157

158158
---
159159

160-
##### `DEFAULT_ALGORITHM`
160+
##### `Cipher.DEFAULT_ALGORITHM`
161161

162162
Specifies default AES algorithms for buffer and stream operations.
163163

164164
<details>
165165
<summary>Properties</summary>
166166

167-
| Operation | Algorithm |
168-
|------------|--------------|
169-
| `buffer` | `aes-256-gcm` |
170-
| `stream` | `aes-256-cbc` |
167+
| Operation | Algorithm | Description |
168+
|------------|--------------|-------------|
169+
| `buffer` | `aes-256-gcm` | Default algorithm used for buffer data encryption/decryption |
170+
| `stream` | `aes-256-cbc` | Default algorithm used for stream encryption/decryption |
171171

172172
</details>
173173

174174
---
175175

176-
##### `ALGORITHMS`
176+
##### `Cipher.ALGORITHMS`
177177

178178
Supported AES algorithms:
179179

@@ -308,7 +308,7 @@ Type: `Promise<void>`
308308
---
309309

310310
- See [`CoerceToUint8ArrayInput`](#coercetouint8arrayinput) for more informations about supported input data types.
311-
- See [`Cph.Stream.Symmetric.EncryptOptions`](#cphstreamsymmetricencryptoptions) for more informations about additional encryption options.
311+
- See [`Cph.Stream.Symmetric.EncryptOptions`](#cphstreamsymmetricencryptoptions) for more informations about encryption options.
312312
- See [In-memory data stream encryption/decryption](#in-memory-data-stream-encryptiondecryption) examples.
313313
- See [File based data stream encryption/decryption](#file-based-data-stream-encryptiondecryption) examples.
314314

@@ -344,7 +344,7 @@ Type: `Promise<void>`
344344
---
345345

346346
- See [`CoerceToUint8ArrayInput`](#coercetouint8arrayinput) for more informations about supported input data types.
347-
- See [`Cph.Stream.Symmetric.DecryptOptions`](#cphstreamsymmetricdecryptoptions) for more informations about additional decryption options.
347+
- See [`Cph.Stream.Symmetric.DecryptOptions`](#cphstreamsymmetricdecryptoptions) for more informations about decryption options.
348348
- See [In-memory data stream encryption/decryption](#in-memory-data-stream-encryptiondecryption) examples.
349349
- See [File based data stream encryption/decryption](#file-based-data-stream-encryptiondecryption) examples.
350350

@@ -381,7 +381,7 @@ Type: `Promise<void>`
381381
---
382382

383383
- See [`CoerceToUint8ArrayInput`](#coercetouint8arrayinput) for more informations about supported input data types.
384-
- See [`Cph.Stream.Hybrid.EncryptOptions`](#cphstreamhybridencryptoptions) for more informations about additional encryption options.
384+
- See [`Cph.Stream.Hybrid.EncryptOptions`](#cphstreamhybridencryptoptions) for more informations about encryption options.
385385
- See [In-memory data stream with hybrid encryption/decryption](#in-memory-data-stream-with-hybrid-encryptiondecryption) examples.
386386
- See [File based data stream with hybrid encryption/decryption](#file-based-data-stream-with-hybrid-encryptiondecryption) examples.
387387

@@ -432,13 +432,13 @@ This module supports different input data types and it uses the [`coerceToUint8A
432432

433433
---
434434

435-
##### `CBCTypes`
435+
##### `Cph.CBCTypes`
436436

437437
Cipher CBC algorithm types.
438438

439439
---
440440

441-
##### `AesAlgorithm`
441+
##### `Cph.AesAlgorithm`
442442

443443
Supported AES algorithm types.
444444

@@ -452,9 +452,9 @@ Common options in encryption/decryption processes.
452452

453453
<summary>Type parameters</summary>
454454

455-
| Parameter | Default | Description |
456-
|-------------|----------------|-------------|
457-
| `T` | `AesAlgorithm` | Accepted algorithm in `Cph.Options`. This is usefull to constraint specifc algorithms. |
455+
| Parameter | Default | Description |
456+
|-----------|----------------|-------------|
457+
| `T` | `Cph.AesAlgorithm` | Accepted algorithm in `Cph.Options`. This is usefull to constraint specifc algorithms. |
458458

459459
</details>
460460

@@ -923,21 +923,19 @@ Run all the defined test suites by running the following:
923923
# Run tests and watch file changes.
924924
pnpm test:watch
925925

926-
# Run tests and watch file changes with jest-environment-jsdom.
927-
pnpm test:jsdom
928-
929926
# Run tests in a CI environment.
930927
pnpm test:ci
931-
932-
# Run tests in a CI environment with jest-environment-jsdom.
933-
pnpm test:ci:jsdom
934928
```
935929

936930
You can eventually run specific suits like so:
937931

938932
```bash
939-
pnpm test:jest
940-
pnpm test:jest:jsdom
933+
pnpm test:buffer-in-memory
934+
pnpm test:file-symmetric
935+
pnpm test:file-hybrid
936+
pnpm test:stream-symmetric
937+
pnpm test:stream-hybrid
938+
pnpm test:misc
941939
```
942940

943941
Run tests with coverage.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"@eslint/js": "^9.18.0",
7272
"@jest/globals": "^29.7.0",
7373
"@types/jest": "^29.5.14",
74-
"@types/node": "^22.10.6",
74+
"@types/node": "^22.10.7",
7575
"concurrently": "^9.1.2",
7676
"dotenv": "^16.4.7",
7777
"eslint": "^9.18.0",

0 commit comments

Comments
 (0)