Skip to main content

check_magic_bytes

Function check_magic_bytes 

Source
pub fn check_magic_bytes(bytes: &[u8]) -> bool
Expand description

Returns true if bytes starts with a FlatCityBuf magic-byte sequence this build can read.

The 8-byte magic is fcb + a major version byte + fcb + a patch byte (see MAGIC_BYTES). Only the two fcb triplets and the major version are checked: byte 3 must be no greater than VERSION, and byte 7 is ignored.

ยงPanics

Panics if bytes is shorter than MAGIC_BYTES_SIZE.