BytesPattern from tupple
This commit is contained in:
parent
90576774fd
commit
3deb961413
@ -57,11 +57,19 @@ impl From<&str> for BytesPattern {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut s = Self {
|
let bytes = HEXUPPER
|
||||||
bytes: HEXUPPER
|
|
||||||
.decode(elements.join("").as_bytes())
|
.decode(elements.join("").as_bytes())
|
||||||
.expect("decode pattern"),
|
.expect("decode pattern");
|
||||||
mask,
|
|
||||||
|
Self::from((bytes, mask))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<(Vec<u8>, Vec<bool>)> for BytesPattern {
|
||||||
|
fn from(x: (Vec<u8>, Vec<bool>)) -> Self {
|
||||||
|
let mut s = Self {
|
||||||
|
bytes: x.0,
|
||||||
|
mask: x.1,
|
||||||
pi: Vec::<usize>::new(),
|
pi: Vec::<usize>::new(),
|
||||||
};
|
};
|
||||||
s.prefix_function();
|
s.prefix_function();
|
||||||
|
Loading…
Reference in New Issue
Block a user