Sha256: replaced call to external sh256sum binary by a pure JS implementaion
This commit is contained in:
parent
1d7b47ee4c
commit
b096f146de
2 changed files with 212 additions and 11 deletions
|
|
@ -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]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue