feat: display sha256 in hex

This commit is contained in:
spacemeowx2 2021-01-01 01:32:58 +08:00
parent be371f891b
commit 01c87972b5

View File

@ -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);