MCPcopy Create free account
hub / github.com/bitpay/bitcore-message / decodeCodePointsArray

Function decodeCodePointsArray

bitcore-message.js:1287–1303  ·  view source on GitHub ↗
(codePoints)

Source from the content-addressed store, hash-verified

1285var MAX_ARGUMENTS_LENGTH = 0x1000
1286
1287function decodeCodePointsArray (codePoints) {
1288 var len = codePoints.length
1289 if (len <= MAX_ARGUMENTS_LENGTH) {
1290 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
1291 }
1292
1293 // Decode in chunks to avoid "call stack size exceeded".
1294 var res = ''
1295 var i = 0
1296 while (i < len) {
1297 res += String.fromCharCode.apply(
1298 String,
1299 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
1300 )
1301 }
1302 return res
1303}
1304
1305function asciiSlice (buf, start, end) {
1306 var ret = ''

Callers 1

utf8SliceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected