capsules_extra::net::util

Function verify_prefix_len

Source
pub fn verify_prefix_len(prefix: &[u8], prefix_len: u8) -> bool
Expand description

Verifies that a prefix given in the form of a byte array slice is valid with respect to its length in bits (prefix_len):

  • The byte array slice must contain enough bytes to cover the prefix length (no implicit zero-padding)
  • The rest of the prefix array slice is zero-padded