MCPcopy Create free account
hub / github.com/TruthHun/BookStack / utf16leToBytes

Function utf16leToBytes

static/word2md/mammoth.browser.js:11449–11463  ·  view source on GitHub ↗
(str, units)

Source from the content-addressed store, hash-verified

11447}
11448
11449function utf16leToBytes (str, units) {
11450 var c, hi, lo
11451 var byteArray = []
11452 for (var i = 0; i < str.length; ++i) {
11453 if ((units -= 2) < 0) break
11454
11455 c = str.charCodeAt(i)
11456 hi = c >> 8
11457 lo = c % 256
11458 byteArray.push(lo)
11459 byteArray.push(hi)
11460 }
11461
11462 return byteArray
11463}
11464
11465function base64ToBytes (str) {
11466 return base64.toByteArray(base64clean(str))

Callers 1

ucs2WriteFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected