Skip to main content

encode

Function encode 

Source
pub fn encode(input: &[u8]) -> Vec<u8> 
Expand description

Encode data using run-length encoding.

  • Matched runs of 2–128 identical bytes → [257 - run_len, byte].
  • Mismatched runs of 1–128 distinct bytes → [run_len - 1, b0, b1, ...].
  • Terminated with the EOD marker 128.

Mirrors PDFium’s BasicModule::RunLengthEncode().