diff --git a/doc/api/buffer.md b/doc/api/buffer.md index bc6aa20b3bc114..897c262fbd5123 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -1375,6 +1375,10 @@ values. ### `buf.readBigUInt64BE([offset])` * `offset` {integer} Number of bytes to skip before starting to read. Must @@ -1396,6 +1400,10 @@ console.log(buf.readBigUInt64BE(0)); added: - v12.0.0 - v10.20.0 +changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/34960 + description: This function is also available as `buf.readBigUint64LE()`. --> * `offset` {integer} Number of bytes to skip before starting to read. Must @@ -2298,6 +2306,10 @@ console.log(buf); added: - v12.0.0 - v10.20.0 +changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/34960 + description: This function is also available as `buf.writeBigUint64BE()`. --> * `value` {bigint} Number to be written to `buf`. @@ -2319,6 +2331,10 @@ console.log(buf); ### `buf.writeBigUInt64LE(value[, offset])` * `value` {bigint} Number to be written to `buf`. diff --git a/lib/internal/buffer.js b/lib/internal/buffer.js index 0ad8d4c0072428..03f12d809d5692 100644 --- a/lib/internal/buffer.js +++ b/lib/internal/buffer.js @@ -951,10 +951,14 @@ class FastBuffer extends Uint8Array {} function addBufferPrototypeMethods(proto) { proto.readBigUInt64LE = readBigUInt64LE, proto.readBigUInt64BE = readBigUInt64BE, + proto.readBigUint64LE = readBigUInt64LE, + proto.readBigUint64BE = readBigUInt64BE, proto.readBigInt64LE = readBigInt64LE, proto.readBigInt64BE = readBigInt64BE, proto.writeBigUInt64LE = writeBigUInt64LE, proto.writeBigUInt64BE = writeBigUInt64BE, + proto.writeBigUint64LE = writeBigUInt64LE, + proto.writeBigUint64BE = writeBigUInt64BE, proto.writeBigInt64LE = writeBigInt64LE, proto.writeBigInt64BE = writeBigInt64BE, diff --git a/test/parallel/test-buffer-writeuint.js b/test/parallel/test-buffer-writeuint.js index 8ca99abc3ddfb7..7667d9381900dd 100644 --- a/test/parallel/test-buffer-writeuint.js +++ b/test/parallel/test-buffer-writeuint.js @@ -222,7 +222,8 @@ const assert = require('assert'); } for (const fn of [ - 'UInt8', 'UInt16LE', 'UInt16BE', 'UInt32LE', 'UInt32BE', 'UIntLE', 'UIntBE' + 'UInt8', 'UInt16LE', 'UInt16BE', 'UInt32LE', 'UInt32BE', 'UIntLE', 'UIntBE', + 'BigUInt64LE', 'BigUInt64BE', ]) { const p = Buffer.prototype; const lowerFn = fn.replace(/UInt/, 'Uint');