MCPcopy Create free account
hub / github.com/alibaba/open-code-review / computeChecksum

Function computeChecksum

scripts/install.js:142–150  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

140}
141
142function computeChecksum(filePath) {
143 return new Promise((resolve, reject) => {
144 const hash = crypto.createHash("sha256");
145 const stream = fs.createReadStream(filePath);
146 stream.on("data", (chunk) => hash.update(chunk));
147 stream.on("end", () => resolve(hash.digest("hex")));
148 stream.on("error", reject);
149 });
150}
151
152async function main() {
153 info("OpenCodeReview Installer");

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected