Skip to content

Commit

Permalink
Make PinId methods public
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Aug 22, 2023
1 parent 203a90d commit c515afc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ const BACKEND_DIR: &str = "backend-auth";
pub struct PinId(u8);

impl PinId {
fn path(&self) -> PathBuf {
pub fn path(&self) -> PathBuf {
let mut path = [0; 6];
path[0..4].copy_from_slice(b"pin.");
path[4..].copy_from_slice(&self.hex());

PathBuf::from(&path)
}

fn hex(&self) -> [u8; 2] {
pub fn hex(&self) -> [u8; 2] {
const CHARS: &[u8; 16] = b"0123456789abcdef";
[
CHARS[usize::from(self.0 >> 4)],
Expand Down

0 comments on commit c515afc

Please sign in to comment.