SplitScript reference / Signature / masked

Signature.masked

Function

Signature.masked(needle: [u8], mask: [u8]) -> Signature!

Creates an owned pattern with arbitrary matching bits.

Arrays must have the same length, between 1 and 255 bytes. Bits outside the mask are cleared. Later changes to either input do not change the pattern.

Parameters

  • needle: Pattern bytes; bits outside the mask are ignored.
  • mask: Bits required to match in each byte.

Effects: allocates, mutates the receiver

Runtime behavior: available everywhere; synchronous

Examples

Match the high three bits and an exact second byte

let signature = Signature.masked([0xbf, 0x12], [0xe0, 0xff])?