mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-21 23:34:48 -07:00
21 lines
410 B
Rust
21 lines
410 B
Rust
use std::{fs, path::Path};
|
|
|
|
use derive_more::Deref;
|
|
|
|
pub const XOR_LEN: usize = 8;
|
|
|
|
#[derive(Debug, Clone, Copy, Deref)]
|
|
pub struct XORBytes([u8; XOR_LEN]);
|
|
|
|
impl From<&Path> for XORBytes {
|
|
#[inline]
|
|
fn from(value: &Path) -> Self {
|
|
Self(
|
|
fs::read(value.join("xor.dat"))
|
|
.unwrap_or(vec![0; 8])
|
|
.try_into()
|
|
.unwrap(),
|
|
)
|
|
}
|
|
}
|