MCPcopy Create free account
hub / github.com/cryptii/cryptii / chunk

Method chunk

src/ArrayUtil.js:119–126  ·  view source on GitHub ↗

* Chunks the given array into slices of equal length. * @param {array} array Array to chunk * @param {number} length Length of one chunk * @return {array} Array of slices

(array, length)

Source from the content-addressed store, hash-verified

117 * @return {array} Array of slices
118 */
119 static chunk (array, length) {
120 const count = Math.ceil(array.length / length)
121 const chunks = new Array(count)
122 for (let i = 0; i < count; i++) {
123 chunks[i] = array.slice(i * length, (i + 1) * length)
124 }
125 return chunks
126 }
127
128 /**
129 * Joins the elements of the given array slices to an array, separated by

Callers 10

StringUtil.jsFile · 0.45
bytesFromHexStringMethod · 0.45
bytesFromBinaryStringMethod · 0.45
updateValueMethod · 0.45
performEncodeMethod · 0.45
performEncodeMethod · 0.45
performDecodeMethod · 0.45
_getVariantMethod · 0.45
performViewMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected