MCPcopy Create free account
hub / github.com/GoogleChrome/samples / intArrayFromString

Function intArrayFromString

mkbitmap/mkbitmap.js:1331–1337  ·  view source on GitHub ↗

@type {function(string, boolean=, number=)}

(stringy, dontAddNull, length)

Source from the content-addressed store, hash-verified

1329 }
1330 /** @type {function(string, boolean=, number=)} */
1331 function intArrayFromString(stringy, dontAddNull, length) {
1332 var len = length > 0 ? length : lengthBytesUTF8(stringy)+1;
1333 var u8array = new Array(len);
1334 var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
1335 if (dontAddNull) u8array.length = numBytesWritten;
1336 return u8array;
1337 }
1338 var TTY = {ttys:[],init:function () {
1339 // https://github.com/emscripten-core/emscripten/pull/1555
1340 // if (ENVIRONMENT_IS_NODE) {

Callers 2

mkbitmap.jsFile · 0.70
doXHRFunction · 0.70

Calls 2

lengthBytesUTF8Function · 0.70
stringToUTF8ArrayFunction · 0.70

Tested by

no test coverage detected