hex: canonical hex->integer parsers + public strip_hex_prefix

Adds parse_hex_u16/u32/u8 and exposes strip_hex_prefix so callers stop hand-rolling
from_str_radix(trim_start_matches("0x")) — a case-sensitive strip that this module
exists to prevent. disc::aacs_disc_hash now uses strip_hex_prefix.
This commit is contained in:
Matthew Jackson
2026-07-17 21:25:59 -07:00
parent 2263d2cc4e
commit 37832ac2dd
2 changed files with 47 additions and 5 deletions
+1 -1
View File
@@ -2435,7 +2435,7 @@ impl Disc {
pub fn aacs_disc_hash(&self) -> String {
self.aacs
.as_ref()
.map(|a| a.disc_hash.trim_start_matches("0x").to_string())
.map(|a| crate::hex::strip_hex_prefix(&a.disc_hash).to_string())
.unwrap_or_default()
}