| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1511,10 +1511,10 @@ Examples: | |||
| 1511 | 1511 | ```js | |
| 1512 | 1512 | const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); | |
| 1513 | 1513 | ||
| 1514 | - // Prints: 1234567890ab | ||
| 1514 | + // Prints: -546f87a9cbee | ||
| 1515 | 1515 | console.log(buf.readIntLE(0, 6).toString(16)); | |
| 1516 | 1516 | ||
| 1517 | - // Prints: -546f87a9cbee | ||
| 1517 | + // Prints: 1234567890ab | ||
| 1518 | 1518 | console.log(buf.readIntBE(0, 6).toString(16)); | |
| 1519 | 1519 | ||
| 1520 | 1520 | // Throws an exception: RangeError: Index out of range | |
@@ -1739,7 +1739,7 @@ console.log(buf1); | |||
| 1739 | 1739 | const buf2 = Buffer.from([0x1, 0x2, 0x3]); | |
| 1740 | 1740 | ||
| 1741 | 1741 | // Throws an exception: RangeError: Buffer size must be a multiple of 16-bits | |
| 1742 | - buf2.swap32(); | ||
| 1742 | + buf2.swap16(); | ||
| 1743 | 1743 | ``` | |
| 1744 | 1744 | ||
| 1745 | 1745 | ### buf.swap32() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments