MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / utf16leToBytes

Function utf16leToBytes

lib/models/dav.js:3615–3629  ·  view source on GitHub ↗
(str, units)

Source from the content-addressed store, hash-verified

3613}
3614
3615function utf16leToBytes (str, units) {
3616 var c, hi, lo;
3617 var byteArray = [];
3618 for (var i = 0; i < str.length; ++i) {
3619 if ((units -= 2) < 0) break
3620
3621 c = str.charCodeAt(i);
3622 hi = c >> 8;
3623 lo = c % 256;
3624 byteArray.push(lo);
3625 byteArray.push(hi);
3626 }
3627
3628 return byteArray
3629}
3630
3631
3632function base64ToBytes (str) {

Callers 1

ucs2WriteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected