Module utils

Module utils 

Source
Expand description

Convenience functions to aid with parsing

Traits§

EntropyCalc
Calculate the entropy of bytes

Functions§

bytes_offset_match
Convenience function to see if a byte sequence in a buffer matches some other byte sequence
entropy_calc
Calculate entropy (0-8) for a byte sequence
f32_from_offset
Convenience function for f32 from a buffer with specified [endian] ordering
f64_from_offset
Convenience function for f64 from a buffer with specified [endian] ordering
find_subsequence
Convenience to see if a smaller byte sequence is in the larger sequence https://stackoverflow.com/questions/35901547/how-can-i-find-a-subsequence-in-a-u8-slice
i32_from_offset
Convenience function for i32 from a buffer with specified [endian] ordering
string_from_offset
Try to get a String from a byte buffer, get a lossy String if it wasn’t UTF-8, or get a hex string as a last resort.
u16_from_offset
Convenience function for u16 from a buffer with specified [endian] ordering
u32_from_offset
Convenience function for u32 from a buffer with specified [endian] ordering
u64_from_offset
Convenience function for u64 from a buffer with specified [endian] ordering