MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / compress

Method compress

src/compression/lz77.rs:121–149  ·  view source on GitHub ↗

Compresses the given text using the LZ77 algorithm. # Arguments `text` - The string to be compressed # Returns A vector of `Token`s representing the compressed data # Examples ``` use the_algorithms_rust::compression::LZ77Compressor; let compressor = LZ77Compressor::new(13, 6); let compressed = compressor.compress("ababcbababaa"); assert_eq!(compressed.len(), 5); ```

(&self, text: &str)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 6

test_default_compressorFunction · 0.80
test_single_characterFunction · 0.80
test_repeated_patternFunction · 0.80

Calls 4

find_encoding_tokenMethod · 0.80
pushMethod · 0.80
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by 6

test_default_compressorFunction · 0.64
test_single_characterFunction · 0.64
test_repeated_patternFunction · 0.64