parser: fixed hanging + global: snapshot

This commit is contained in:
nym21
2025-02-23 21:53:39 +01:00
parent 19cf34f9d4
commit 8acbcc548c
30 changed files with 372 additions and 383 deletions

View File

@@ -0,0 +1,19 @@
use std::{fs, path::Path};
use derive_deref::Deref;
pub const XOR_LEN: usize = 8;
#[derive(Debug, Clone, Copy, Deref)]
pub struct XORBytes([u8; XOR_LEN]);
impl From<&Path> for XORBytes {
fn from(value: &Path) -> Self {
Self(
fs::read(value.join("blocks/xor.dat"))
.unwrap_or(vec![0; 8])
.try_into()
.unwrap(),
)
}
}