Crate binmatch

Source
Expand description

A simple binary pattern matching library

Basic Usage looks like this:

let pattern = Pattern::new("00 __ 00 ??").unwrap();
let data = vec![0x12, 0x13, 0x00, 0x14, 0x00, 0x42, 0x15];
let matches = pattern.find_matches(data); // Or Pattern::find_matches_with_index if you need the index
assert_eq!(matches, vec![0x42]);

All needed functions can be found in Pattern

§Usage with #![no_std]

First off, disable the default feature std
cargo add binmatch --no-default-features
The normal Pattern::new is no longer accesible, because it needs std to function
Every time you wish to create a new Pattern you now have to use Pattern::new_unchecked

Structs§

Pattern

Enums§

BinmatchError

Constants§

ALLOWED_ALPHABET
OSZAR »