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

Function utf16leSlice

bitcore-message.js:1338–1345  ·  view source on GitHub ↗
(buf, start, end)

Source from the content-addressed store, hash-verified

1336}
1337
1338function utf16leSlice (buf, start, end) {
1339 var bytes = buf.slice(start, end)
1340 var res = ''
1341 for (var i = 0; i < bytes.length; i += 2) {
1342 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
1343 }
1344 return res
1345}
1346
1347Buffer.prototype.slice = function slice (start, end) {
1348 var len = this.length

Callers 1

slowToStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected