MCPcopy Create free account
hub / github.com/hoothin/UserScripts / stringToArrayLike

Function stringToArrayLike

Picviewer CE+/Picviewer CE+.user.js:3381–3386  ·  view source on GitHub ↗

* Fill in an array with a string. * @param {String} str the string to use. * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to fill in (will be mutated). * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array.

(str, array)

Source from the content-addressed store, hash-verified

3379 * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array.
3380 */
3381function stringToArrayLike(str, array) {
3382 for (var i = 0; i < str.length; ++i) {
3383 array[i] = str.charCodeAt(i) & 0xFF;
3384 }
3385 return array;
3386}
3387
3388/**
3389 * An helper for the function arrayLikeToString.

Callers 2

string2binaryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected