Skip to main content

encode_payload

Function encode_payload 

Source
pub fn encode_payload(
    text: &str,
    files: &[FileEntry],
) -> Result<Vec<u8>, StegoError>
Expand description

Encode a payload (text + optional files) into bytes ready for encryption.

Returns [flags byte][maybe_compressed_inner]. The caller encrypts this as the “plaintext” in the frame format.

Tries Brotli compression and uses it only if it produces a smaller result.

Returns an error if any file exceeds MAX_RAW_FILE_SIZE or has a filename longer than 255 bytes.