MCPcopy Create free account
hub / github.com/mscdex/ssh2 / bufferCopy

Function bufferCopy

lib/protocol/utils.js:17–29  ·  view source on GitHub ↗
(src, dest, srcStart, srcEnd, destStart)

Source from the content-addressed store, hash-verified

15}
16
17function bufferCopy(src, dest, srcStart, srcEnd, destStart) {
18 if (!destStart)
19 destStart = 0;
20 if (srcEnd > src.length)
21 srcEnd = src.length;
22 let nb = srcEnd - srcStart;
23 const destLeft = (dest.length - destStart);
24 if (nb > destLeft)
25 nb = destLeft;
26 dest.set(new Uint8Array(src.buffer, src.byteOffset + srcStart, nb),
27 destStart);
28 return nb;
29}
30
31function bufferSlice(buf, start, end) {
32 if (end === undefined)

Callers 14

hostKeysProveFunction · 0.85
openMethod · 0.85
writeMethod · 0.85
mkdirMethod · 0.85
setstatMethod · 0.85
fsetstatMethod · 0.85
ext_openssh_lsetstatMethod · 0.85
nameMethod · 0.85
attrsMethod · 0.85
authPasswordMethod · 0.85
authHostbasedMethod · 0.85
openssh_hostKeysProveMethod · 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…