We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 588ca83 commit 1d950adCopy full SHA for 1d950ad
src/rust/bitbox02-rust/src/workflow/pairing.rs
@@ -21,8 +21,8 @@ use alloc::string::String;
21
pub fn format_hash(hash: &[u8; 32]) -> String {
22
let mut encoded = [0u8; 60];
23
let encoded = binascii::b32encode(&hash[..], &mut encoded).unwrap();
24
- // Base32 contains only utf-8 valid chars. unwrap is safe
25
- let encoded = core::str::from_utf8(encoded).expect("invalid utf-8");
+ // Base32 contains only utf-8 valid chars.
+ let encoded = unsafe { core::str::from_utf8_unchecked(encoded) };
26
format!(
27
"{} {}\n{} {}",
28
&encoded[0..5],
0 commit comments