bech32 0.8

This commit is contained in:
Jack Grigg
2021-03-29 10:43:57 +13:00
parent 15081ac948
commit 50e4fee48c
4 changed files with 26 additions and 12 deletions
+9 -5
View File
@@ -1,6 +1,6 @@
//! Structs for handling YubiKeys.
use bech32::ToBase32;
use bech32::{ToBase32, Variant};
use std::fmt;
use std::thread::sleep;
use std::time::{Duration, SystemTime};
@@ -81,10 +81,14 @@ pub struct Stub {
impl fmt::Display for Stub {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(
bech32::encode(IDENTITY_PREFIX, self.to_bytes().to_base32())
.expect("HRP is valid")
.to_uppercase()
.as_str(),
bech32::encode(
IDENTITY_PREFIX,
self.to_bytes().to_base32(),
Variant::Bech32,
)
.expect("HRP is valid")
.to_uppercase()
.as_str(),
)
}
}