buf.readBigUInt64BE([offset])
从指定的 offset
处的 buf
读取无符号的大端序 64 位整数。
此函数也可在 readBigUint64BE
别名下使用。
import { Buffer } from 'node:buffer';
const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
console.log(buf.readBigUInt64BE(0));
// 打印: 4294967295n
const { Buffer } = require('node:buffer');
const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
console.log(buf.readBigUInt64BE(0));
// 打印: 4294967295n
offset
<integer> Number of bytes to skip before starting to read. Must satisfy:0 <= offset <= buf.length - 8
. Default:0
.- Returns: <bigint>
Reads an unsigned, big-endian 64-bit integer from buf
at the specified
offset
.
This function is also available under the readBigUint64BE
alias.
import { Buffer } from 'node:buffer';
const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
console.log(buf.readBigUInt64BE(0));
// Prints: 4294967295n
const { Buffer } = require('node:buffer');
const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
console.log(buf.readBigUInt64BE(0));
// Prints: 4294967295n