Skip to content

Commit

Permalink
added sha512 (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenOfTheRaven authored Jul 23, 2024
1 parent 0c617c9 commit 3a87912
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions gtk/src/app/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use dbus_udisks2::{DiskDevice, Disks, UDisks2};
use md5::Md5;
use sha1::Sha1;
use sha2::Sha256;
use sha2::Sha512;
use std::collections::HashMap;
use std::io;
use std::path::PathBuf;
Expand Down Expand Up @@ -46,6 +47,7 @@ pub fn background_thread(events_tx: Sender<UiEvent>, events_rx: Receiver<Backgro
"MD5" => hasher::<Md5>(&path),
"SHA256" => hasher::<Sha256>(&path),
"SHA1" => hasher::<Sha1>(&path),
"SHA512" => hasher::<Sha512>(&path),
_ => Err(io::Error::new(
io::ErrorKind::InvalidInput,
"hash kind not supported",
Expand Down
7 changes: 4 additions & 3 deletions gtk/src/app/signals/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ fn set_hash_widget(state: &State, ui: &GtkUi) {

let path = state.image_path.borrow();
let kind = match hash.active() {
Some(1) => "SHA256",
Some(2) => "SHA1",
Some(3) => "MD5",
Some(1) => "SHA512",
Some(2) => "SHA256",
Some(3) => "SHA1",
Some(4) => "MD5",
_ => return,
};

Expand Down
1 change: 1 addition & 0 deletions gtk/src/app/views/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl ImageView {
let hash = cascade! {
ComboBoxText::new();
..append_text(&fl!("none"));
..append_text("SHA512");
..append_text("SHA256");
..append_text("SHA1");
..append_text("MD5");
Expand Down

0 comments on commit 3a87912

Please sign in to comment.