Sha256: replaced call to external sh256sum binary by a pure JS implementaion

This commit is contained in:
quadbyte 2025-08-19 13:34:14 -04:00
parent 1d7b47ee4c
commit b096f146de
2 changed files with 212 additions and 11 deletions

View file

@ -4,6 +4,7 @@ import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import "../Helpers/sha256.js" as Crypto
Image {
id: root
@ -20,8 +21,8 @@ Image {
smooth: true
onImagePathChanged: {
if (imagePath) {
hashProcess.command = ["sha256sum", imagePath]
hashProcess.running = true
imageHash = Crypto.sha256(imagePath)
Logger.log("NImageCached", imagePath, imageHash)
} else {
source = ""
imageHash = ""
@ -47,13 +48,4 @@ Image {
})
}
}
Process {
id: hashProcess
stdout: StdioCollector {
onStreamFinished: {
root.imageHash = text.split(" ")[0]
}
}
}
}