MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / _writeUInt32

Function _writeUInt32

MathBox/mathbox-bundle.js:48331–48348  ·  view source on GitHub ↗
(buf, value, offset, littleEndian, noAssert)

Source from the content-addressed store, hash-verified

48329}
48330
48331function _writeUInt32 (buf, value, offset, littleEndian, noAssert) {
48332 if (!noAssert) {
48333 assert(value !== undefined && value !== null, 'missing value')
48334 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
48335 assert(offset !== undefined && offset !== null, 'missing offset')
48336 assert(offset + 3 < buf.length, 'trying to write beyond buffer length')
48337 verifuint(value, 0xffffffff)
48338 }
48339
48340 var len = buf.length
48341 if (offset >= len)
48342 return
48343
48344 for (var i = 0, j = Math.min(len - offset, 4); i < j; i++) {
48345 buf[offset + i] =
48346 (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
48347 }
48348}
48349
48350Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) {
48351 _writeUInt32(this, value, offset, true, noAssert)

Callers 2

mathbox-bundle.jsFile · 0.70
_writeInt32Function · 0.70

Calls 2

assertFunction · 0.70
verifuintFunction · 0.70

Tested by

no test coverage detected