Spaces:
Configuration error
Configuration error
Download src/security/checksum.js from UUUZCX/video-optimizer-bot: direct link, hf CLI and curl.
- Browser
- Download file 428 Bytes
-
https://huggingface.co/spaces/UUUZCX/video-optimizer-bot/resolve/main/src/security/checksum.js
- Command line
-
hf download hf://spaces/UUUZCX/video-optimizer-bot/src/security/checksum.js
-
curl -L -o checksum.js https://huggingface.co/spaces/UUUZCX/video-optimizer-bot/resolve/main/src/security/checksum.js
428 Bytes
| const crypto = require("node:crypto"); | |
| const fs = require("node:fs"); | |
| function sha256File(filePath) { | |
| return new Promise((resolve, reject) => { | |
| const hash = crypto.createHash("sha256"); | |
| const stream = fs.createReadStream(filePath); | |
| stream.on("data", (chunk) => hash.update(chunk)); | |
| stream.on("error", reject); | |
| stream.on("end", () => resolve(hash.digest("hex"))); | |
| }); | |
| } | |
| module.exports = { sha256File }; | |