Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function sha1(path: string) {
const d = new Deferred()
const readStream = fse.createReadStream(path, { autoClose: true })
const sha = createHash("sha1")
readStream.on("data", ea => sha.update(ea))
readStream.on("error", err => d.reject(err))
readStream.on("end", () => d.resolve(sha.digest().toString("hex")))
return d.promise
}
export function sha1(path: string) {
const d = new Deferred()
const readStream = fse.createReadStream(path, { autoClose: true })
const sha = createHash("sha1")
readStream.on("data", ea => sha.update(ea))
readStream.on("error", err => d.reject(err))
readStream.on("end", () => d.resolve(sha.digest().toString("hex")))
return d.promise
}