buf.readBigUInt64LE([offset])
版本历史
| 版本 | 变更 |
|---|---|
| v14.10.0, v12.19.0 | 此函数也可用作 |
| v12.0.0, v10.20.0 | 新增于: v12.0.0, v10.20.0 |
-
offset<integer> 开始读取之前要跳过的字节数。必须满足:0 <= offset <= buf.length - 8。默认值:0。\
offset<integer> Number of bytes to skip before starting to read. Must satisfy:0 <= offset <= buf.length - 8. Default:0. -
返回:<bigint>
\Returns: <bigint>
从指定的 offset 处的 buf 读取无符号的小端序 64 位整数。
\Reads an unsigned, little-endian 64-bit integer from buf at the specified
offset.
此函数也可在 readBigUint64LE 别名下使用。
\This function is also available under the readBigUint64LE alias.
import { Buffer } from 'node:buffer'; const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); console.log(buf.readBigUInt64LE(0)); // Prints: 18446744069414584320nconst { Buffer } = require('node:buffer'); const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); console.log(buf.readBigUInt64LE(0)); // Prints: 18446744069414584320n