MCPcopy Create free account
hub / github.com/dfinity/orbit / compress_to_gzip

Function compress_to_gzip

tests/integration/src/utils.rs:904–908  ·  view source on GitHub ↗

Compresses the given data to a gzip format.

(data: &[u8])

Source from the content-addressed store, hash-verified

902
903/// Compresses the given data to a gzip format.
904pub fn compress_to_gzip(data: &[u8]) -> Vec<u8> {
905 let mut encoder = GzEncoder::new(Vec::new(), Compression::best());
906 encoder.write_all(data).expect("Failed to write data");
907 encoder.finish().expect("Failed to finish compression")
908}
909
910/// Creates a file in the `assets` folder with the given name and content.
911pub fn create_file(name: &str, content: &[u8]) {

Calls

no outgoing calls