| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 82c2939 commit 17a9846
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1518,9 +1518,7 @@ hash.end(); | |||
| 1518 | 1518 | Example: Using `Hash` and piped streams: | |
| 1519 | 1519 | ||
| 1520 | 1520 | ```mjs | |
| 1521 | - const { | ||
| 1522 | - createReadStream, | ||
| 1523 | - } = require('fs'); | ||
| 1521 | + import { createReadStream } from 'fs'; | ||
| 1524 | 1522 | ||
| 1525 | 1523 | const { | |
| 1526 | 1524 | createHash, | |
@@ -1551,7 +1549,7 @@ Example: Using the [`hash.update()`][] and [`hash.digest()`][] methods: | |||
| 1551 | 1549 | ```mjs | |
| 1552 | 1550 | const { | |
| 1553 | 1551 | createHash, | |
| 1554 | - } = require('crypto'); | ||
| 1552 | + } = await import('crypto'); | ||
| 1555 | 1553 | ||
| 1556 | 1554 | const hash = createHash('sha256'); | |
| 1557 | 1555 | ||
@@ -1596,7 +1594,7 @@ its [`hash.digest()`][] method has been called. | |||
| 1596 | 1594 | // Calculate a rolling hash. | |
| 1597 | 1595 | const { | |
| 1598 | 1596 | createHash, | |
| 1599 | - } = require('crypto'); | ||
| 1597 | + } = await import('crypto'); | ||
| 1600 | 1598 | ||
| 1601 | 1599 | const hash = createHash('sha256'); | |
| 1602 | 1600 | ||
@@ -1691,7 +1689,7 @@ Example: Using `Hmac` objects as streams: | |||
| 1691 | 1689 | ```mjs | |
| 1692 | 1690 | const { | |
| 1693 | 1691 | createHmac, | |
| 1694 | - } = require('crypto'); | ||
| 1692 | + } = await import('crypto'); | ||
| 1695 | 1693 | ||
| 1696 | 1694 | const hmac = createHmac('sha256', 'a secret'); | |
| 1697 | 1695 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments