1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Hex formatting helper for `Debug` output.
//!
//! Raw byte fields (AIDs, ATR/ATS, install parameters, APDU data, KCVs, …)
//! derive-print as decimal arrays like `[160, 0, 0, 1]`, which is unreadable for
//! smart-card debugging. [`HexBytes`] renders them as an uppercase hex string in
//! quotes, e.g. `"A0000001"`. It is `pub(crate)`: types embed it inside their own
//! manual `Debug` impls (see `aid.rs`, `model.rs`, `report.rs`).
use fmt;
/// `Debug`-formats a byte slice as a quoted uppercase hex string.
///
/// `HexBytes(&[0xA0, 0x00])` ⇒ `"A000"`; empty ⇒ `""`.
pub ;
/// `Debug`-formats a single byte as a `0x`-prefixed two-digit uppercase hex
/// literal.
///
/// `HexByte(0x30)` ⇒ `0x30`; `HexByte(0)` ⇒ `0x00`. Used for protocol scalars
/// (key version numbers, SCP `i` parameter, …) where the hex value is the
/// meaningful form for smart-card debugging rather than the decimal `48`/`112`.
pub ;