MCPcopy Create free account
hub / github.com/microsoft/SandDance / utf16leSlice

Function utf16leSlice

docs/app/js/sanddance-app.js:113564–113570  ·  view source on GitHub ↗
(buf, start, end)

Source from the content-addressed store, hash-verified

113562 return out;
113563}
113564function utf16leSlice(buf, start, end) {
113565 var bytes = buf.slice(start, end);
113566 var res = "";
113567 // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)
113568 for(var i = 0; i < bytes.length - 1; i += 2)res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
113569 return res;
113570}
113571Buffer.prototype.slice = function slice(start, end) {
113572 var len = this.length;
113573 start = ~~start;

Callers 1

slowToStringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected