Truncate secret hash using precision
Currently we are attempting to truncate the hash created using
`bitcoin_hashes` by using the "width" formatting parameter instead of
the "precision" parameter. `hex-conservative` truncates with the
"precision" parameter as is expected since a hash is not an integral
type.
Use the formatting string `"{:.16}"` which is the "precision"
formatting parameter.
This commit is contained in:
parent
4b143d6f9c
commit
3d1ce0d261
|
|
@ -46,7 +46,7 @@ macro_rules! impl_display_secret {
|
|||
engine.input(&self.secret_bytes());
|
||||
let hash = sha256::Hash::from_engine(engine);
|
||||
|
||||
f.debug_tuple(stringify!($thing)).field(&format_args!("#{:016x}", hash)).finish()
|
||||
f.debug_tuple(stringify!($thing)).field(&format_args!("#{:.16}", hash)).finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue