src/types/primitive.js
function insertIntegerToByteArray (number, buffer, from, size) {
  let value = bigInt(number) // convert a number-like object into a big integer

  for (let pos = 0; pos < size; pos++) {
    const divmod = value.divmod(256)
    buffer[from + pos] = divmod.remainder.toJSNumber()
    value = divmod.quotient
  }

  return buffer
}
function insertIntegerToByteArray (number, buffer, from, size) {
  let value = bigInt(number) // convert a number-like object into a big integer

  for (let pos = 0; pos < size; pos++) {
    const divmod = value.divmod(256)
    buffer[from + pos] = divmod.remainder.toJSNumber()
    value = divmod.quotient
  }

  return buffer
}
function insertIntegerToByteArray ( number , buffer , from , size ) { let value = bigInt ( number ) // convert a number-like object into a big integer for ( let pos = 0 ; pos < size ; pos ++ ) { const divmod = value . divmod ( 256 ) buffer [ from + pos ] = divmod . remainder . toJSNumber ( ) value = divmod . quotient } return buffer }
Insert number into array as as little-endian
@param {number|bigInt} number
@param {Array} buffer
@param {number} from
@param {number} size
@returns {boolean}
Insert number into array as as little - endian