MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / padEnd

Function padEnd

Hashes/MD5.js:104–110  ·  view source on GitHub ↗

* Adds padding to the end of the given array * * @param {Uint8Array} u8Array Array to pad * @param {number} size Resulting size of the array

(u8Array, size)

Source from the content-addressed store, hash-verified

102 * @param {number} size Resulting size of the array
103 */
104function padEnd(u8Array, size) {
105 const result = new Uint8Array(size)
106 result.set(u8Array)
107 result.fill(0, u8Array.length)
108
109 return result
110}
111
112/**
113 * Pre-processes message to feed the algorithm loop

Callers 1

preProcessFunction · 0.85

Calls 1

setMethod · 0.45

Tested by

no test coverage detected