MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / delta

Function delta

atomic-core/examples/semantic_codec_lab/context.rs:10–14  ·  view source on GitHub ↗
(out: &mut Vec<u8>, previous: &mut u64, n: u64)

Source from the content-addressed store, hash-verified

8 Ok(*previous)
9}
10fn delta(out: &mut Vec<u8>, previous: &mut u64, n: u64) {
11 let d = n.wrapping_sub(*previous);
12 transforms::put(out, (d << 1) ^ ((d as i64 >> 63) as u64));
13 *previous = n;
14}
15
16pub fn split_references(view: &View<'_>) -> Result<Vec<u8>> {
17 let mut input = view.references;

Callers 2

split_referencesFunction · 0.70
join_referencesFunction · 0.70

Calls 1

putFunction · 0.70

Tested by

no test coverage detected