MCPcopy Index your code
hub / github.com/nodejs/node / streamWrite

Function streamWrite

benchmark/crypto/hash-stream-creation.js:61–78  ·  view source on GitHub ↗
(algo, message, encoding, n, len, outEnc)

Source from the content-addressed store, hash-verified

59}
60
61function streamWrite(algo, message, encoding, n, len, outEnc) {
62 const written = n * len;
63 const bits = written * 8;
64 const gbits = bits / (1024 * 1024 * 1024);
65
66 while (n-- > 0) {
67 const h = crypto.createHash(algo);
68
69 if (outEnc !== 'buffer')
70 h.setEncoding(outEnc);
71
72 h.write(message, encoding);
73 h.end();
74 h.read();
75 }
76
77 bench.end(gbits);
78}

Callers

nothing calls this directly

Calls 4

setEncodingMethod · 0.45
writeMethod · 0.45
endMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…