MCPcopy Create free account
hub / github.com/SocketCluster/socketcluster / utf16leToBytes

Function utf16leToBytes

app/public/socketcluster-client.js:4353–4367  ·  view source on GitHub ↗
(str, units)

Source from the content-addressed store, hash-verified

4351}
4352
4353function utf16leToBytes (str, units) {
4354 var c, hi, lo
4355 var byteArray = []
4356 for (var i = 0; i < str.length; ++i) {
4357 if ((units -= 2) < 0) break
4358
4359 c = str.charCodeAt(i)
4360 hi = c >> 8
4361 lo = c % 256
4362 byteArray.push(lo)
4363 byteArray.push(hi)
4364 }
4365
4366 return byteArray
4367}
4368
4369function base64ToBytes (str) {
4370 return base64.toByteArray(base64clean(str))

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…