MCPcopy Create free account
hub / github.com/bitpay/bitcore-message / checkOffset

Function checkOffset

bitcore-message.js:1386–1389  ·  view source on GitHub ↗
(offset, ext, length)

Source from the content-addressed store, hash-verified

1384 * Need to make sure that buffer isn't trying to write out of bounds.
1385 */
1386function checkOffset (offset, ext, length) {
1387 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
1388 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
1389}
1390
1391Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
1392 offset = offset | 0

Callers 1

bitcore-message.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected