| 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, | |
@@ -3287,7 +3289,7 @@ Example: generating the sha256 sum of a file | |||
| 3287 | 3289 | ```mjs | |
| 3288 | 3290 | import { | |
| 3289 | 3291 | createReadStream | |
| 3290 | - } from 'fs'; | ||
| 3292 | + } from 'node:fs'; | ||
| 3291 | 3293 | import { argv } from 'node:process'; | |
| 3292 | 3294 | const { | |
| 3293 | 3295 | createHash | |
@@ -3373,7 +3375,7 @@ Example: generating the sha256 HMAC of a file | |||
| 3373 | 3375 | ```mjs | |
| 3374 | 3376 | import { | |
| 3375 | 3377 | createReadStream | |
| 3376 | - } from 'fs'; | ||
| 3378 | + } from 'node:fs'; | ||
| 3377 | 3379 | import { argv } from 'node:process'; | |
| 3378 | 3380 | const { | |
| 3379 | 3381 | createHmac | |
| Back | FazBrowse Home | New Git URL |
0 commit comments