read_version

Function read_version 

Source
pub fn read_version<R: Read>(reader: R) -> Result<u8, AescryptError>
Expand description

Reads just enough of the file to determine the AES Crypt version (0–3).

This function is deliberately lenient with v0 files (3-byte or 4-byte headers) because that’s how the original AES Crypt tools behaved.

Returns Ok(version) or an appropriate error.