Files
rayhunter/lib/src/test_util.rs
T
Will Greenberg 30f663be2f lib: serialize MAC RACH attempts to GSMTAP
This also refactors the gsmtap code into a neater module, and adds MAC
UL & DL logs to our diag capture.
2026-07-16 11:54:57 -07:00

12 lines
383 B
Rust

use deku::reader::Reader;
use std::io::Cursor;
pub fn unhexlify(hexlified_bytes: &str) -> (usize, Reader<Cursor<Vec<u8>>>) {
let byte_len = hexlified_bytes.len() / 2;
let bytes = (0..hexlified_bytes.len())
.step_by(2)
.map(|i| u8::from_str_radix(&hexlified_bytes[i..i + 2], 16).unwrap())
.collect();
(byte_len, Reader::new(Cursor::new(bytes)))
}