MCPcopy Create free account
hub / github.com/SocketCluster/socketcluster / checkOffset

Function checkOffset

app/public/socketcluster-client.js:3720–3723  ·  view source on GitHub ↗
(offset, ext, length)

Source from the content-addressed store, hash-verified

3718 * Need to make sure that buffer isn't trying to write out of bounds.
3719 */
3720function checkOffset (offset, ext, length) {
3721 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
3722 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
3723}
3724
3725Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
3726 offset = offset >>> 0

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…