MCPcopy Index your code
hub / github.com/plotly/plotly.js / utf16leToBytes

Function utf16leToBytes

stackgl_modules/index.js:1490–1502  ·  view source on GitHub ↗
(str, units)

Source from the content-addressed store, hash-verified

1488 return byteArray;
1489}
1490function utf16leToBytes(str, units) {
1491 var c, hi, lo;
1492 var byteArray = [];
1493 for (var i = 0; i < str.length; ++i) {
1494 if ((units -= 2) < 0) break;
1495 c = str.charCodeAt(i);
1496 hi = c >> 8;
1497 lo = c % 256;
1498 byteArray.push(lo);
1499 byteArray.push(hi);
1500 }
1501 return byteArray;
1502}
1503function base64ToBytes(str) {
1504 return base64.toByteArray(base64clean(str));
1505}

Callers 1

ucs2WriteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…