Function resol_vbus::utils::has_msb_set

source ·
pub fn has_msb_set(buf: &[u8]) -> bool
Expand description

Checks a slice of bytes whether one of them has its MSB set.

Examples

use resol_vbus::utils::has_msb_set;

let bytes = &[ 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80 ];

assert_eq!(false, has_msb_set(&bytes [0..8]));
assert_eq!(true, has_msb_set(&bytes [0..9]));