From 01c87972b552461f54365a7c75598cd479a01536 Mon Sep 17 00:00:00 2001 From: spacemeowx2 Date: Fri, 1 Jan 2021 01:32:58 +0800 Subject: [PATCH] feat: display sha256 in hex --- blflash/src/flasher.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/blflash/src/flasher.rs b/blflash/src/flasher.rs index 3e276e2..89bda8e 100644 --- a/blflash/src/flasher.rs +++ b/blflash/src/flasher.rs @@ -116,7 +116,11 @@ impl Flasher { .eflash_loader() .sha256_read(segment.addr, segment.size())?; if sha256 != &local_hash[..] { - log::warn!("sha256 not match: {:x?} != {:x?}", sha256, local_hash); + log::warn!( + "sha256 not match: {} != {}", + hex::encode(sha256), + hex::encode(local_hash) + ); } } Ok(()) @@ -136,10 +140,10 @@ impl Flasher { .sha256_read(segment.addr, segment.size())?; if sha256 != &local_hash[..] { log::warn!( - "{:x} sha256 not match: {:x?} != {:x?}", + "{:x} sha256 not match: {} != {}", segment.addr, - sha256, - local_hash + hex::encode(sha256), + hex::encode(local_hash) ); } else { log::info!("{:x} sha256 match", segment.addr);