| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -395,11 +395,11 @@ Example: Using `Cipher` and piped streams: | |||
| 395 | 395 | import { | |
| 396 | 396 | createReadStream, | |
| 397 | 397 | createWriteStream, | |
| 398 | - } from 'fs'; | ||
| 398 | + } from 'node:fs'; | ||
| 399 | 399 | ||
| 400 | 400 | import { | |
| 401 | 401 | pipeline | |
| 402 | - } from 'stream'; | ||
| 402 | + } from 'node:stream'; | ||
| 403 | 403 | ||
| 404 | 404 | const { | |
| 405 | 405 | scrypt, | |
@@ -675,6 +675,7 @@ const decipher = createDecipheriv(algorithm, key, iv); | |||
| 675 | 675 | ||
| 676 | 676 | let decrypted = ''; | |
| 677 | 677 | decipher.on('readable', () => { | |
| 678 | + let chunk; | ||
| 678 | 679 | while (null !== (chunk = decipher.read())) { | |
| 679 | 680 | decrypted += chunk.toString('utf8'); | |
| 680 | 681 | } | |
@@ -711,6 +712,7 @@ const decipher = createDecipheriv(algorithm, key, iv); | |||
| 711 | 712 | ||
| 712 | 713 | let decrypted = ''; | |
| 713 | 714 | decipher.on('readable', () => { | |
| 715 | + let chunk; | ||
| 714 | 716 | while (null !== (chunk = decipher.read())) { | |
| 715 | 717 | decrypted += chunk.toString('utf8'); | |
| 716 | 718 | } | |
@@ -733,7 +735,7 @@ Example: Using `Decipher` and piped streams: | |||
| 733 | 735 | import { | |
| 734 | 736 | createReadStream, | |
| 735 | 737 | createWriteStream, | |
| 736 | - } from 'fs'; | ||
| 738 | + } from 'node:fs'; | ||
| 737 | 739 | import { Buffer } from 'node:buffer'; | |
| 738 | 740 | const { | |
| 739 | 741 | scryptSync, | |
@@ -3305,7 +3307,7 @@ Example: generating the sha256 sum of a file | |||
| 3305 | 3307 | ```mjs | |
| 3306 | 3308 | import { | |
| 3307 | 3309 | createReadStream | |
| 3308 | - } from 'fs'; | ||
| 3310 | + } from 'node:fs'; | ||
| 3309 | 3311 | import { argv } from 'node:process'; | |
| 3310 | 3312 | const { | |
| 3311 | 3313 | createHash | |
@@ -3391,7 +3393,7 @@ Example: generating the sha256 HMAC of a file | |||
| 3391 | 3393 | ```mjs | |
| 3392 | 3394 | import { | |
| 3393 | 3395 | createReadStream | |
| 3394 | - } from 'fs'; | ||
| 3396 | + } from 'node:fs'; | ||
| 3395 | 3397 | import { argv } from 'node:process'; | |
| 3396 | 3398 | const { | |
| 3397 | 3399 | createHmac | |
| Back | FazBrowse Home | New Git URL |
0 commit comments