Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,11 @@ Example: Using `Cipher` and piped streams:
import {
createReadStream,
createWriteStream,
} from 'fs';
} from 'node:fs';

import {
pipeline
} from 'stream';
} from 'node:stream';

const {
scrypt,
Expand Down Expand Up @@ -674,7 +674,7 @@ const iv = Buffer.alloc(16, 0); // Initialization vector.
const decipher = createDecipheriv(algorithm, key, iv);

let decrypted = '';
decipher.on('readable', () => {
decipher.on('readable', (chunk) => {
Comment thread
aduh95 marked this conversation as resolved.
Outdated
while (null !== (chunk = decipher.read())) {
decrypted += chunk.toString('utf8');
}
Expand Down Expand Up @@ -710,7 +710,7 @@ const iv = Buffer.alloc(16, 0); // Initialization vector.
const decipher = createDecipheriv(algorithm, key, iv);

let decrypted = '';
decipher.on('readable', () => {
decipher.on('readable', (chunk) => {
Comment thread
aduh95 marked this conversation as resolved.
Outdated
while (null !== (chunk = decipher.read())) {
decrypted += chunk.toString('utf8');
}
Expand All @@ -733,7 +733,7 @@ Example: Using `Decipher` and piped streams:
import {
createReadStream,
createWriteStream,
} from 'fs';
} from 'node:fs';
import { Buffer } from 'node:buffer';
const {
scryptSync,
Expand Down Expand Up @@ -3311,7 +3311,7 @@ Example: generating the sha256 sum of a file
```mjs
import {
createReadStream
} from 'fs';
} from 'node:fs';
import { argv } from 'node:process';
const {
createHash
Expand Down Expand Up @@ -3397,7 +3397,7 @@ Example: generating the sha256 HMAC of a file
```mjs
import {
createReadStream
} from 'fs';
} from 'node:fs';
import { argv } from 'node:process';
const {
createHmac
Expand Down