MCPcopy Create free account
hub / github.com/RustCrypto/utils / encode

Function encode

blobby/src/bin/encode.rs:43–53  ·  view source on GitHub ↗
(reader: impl BufRead, mut writer: impl Write)

Source from the content-addressed store, hash-verified

41 }
42
43 fn encode(reader: impl BufRead, mut writer: impl Write) -> io::Result<usize> {
44 let mut blobs = Vec::new();
45 for line in reader.lines() {
46 let blob = decode_hex(&line?)?;
47 blobs.push(blob);
48 }
49 let (data, idx_len) = encode_blobs(&blobs);
50 println!("Index len: {idx_len:?}");
51 writer.write_all(&data)?;
52 Ok(blobs.len())
53 }
54
55 let args: Vec<String> = env::args().skip(1).collect();
56

Callers 1

mainFunction · 0.85

Calls 3

decode_hexFunction · 0.85
encode_blobsFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected