buf.readUInt32BE()函數詳解


buf.readUInt32BE(offset[, noAssert])
buf.readUInt32LE(offset[, noAssert])

  • offset {Number} 0 <= offset <= buf.length - 4
  • noAssert {Boolean} 默認:false
  • 返回:{Number}
從該 Buffer 指定的帶有特定尾數格式(readUInt32BE() 返回一個較大的尾數,readUInt32LE() 返回一個較小的尾數)的 offset 位置開始讀取一個無符號的32位整數值。 設置 noAssert 為 true ,將跳過對 offset 的驗證。這將允許 offset 超出緩沖區的末尾。 例子: ``` const buf = Buffer.from([0x3, 0x4, 0x23, 0x42]);

buf.readUInt32BE(0);
// Returns: 0x03042342
console.log(buf.readUInt32LE(0));
// Returns: 0x42230403


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM