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

Function undelta

atomic-core/examples/compact_semantic_codec/codec.rs:59–64  ·  view source on GitHub ↗
(input: &mut &[u8], previous: &mut u64)

Source from the content-addressed store, hash-verified

57}
58
59fn undelta(input: &mut &[u8], previous: &mut u64) -> Result<u64> {
60 let z = get(input)?;
61 let d = (z >> 1) ^ 0u64.wrapping_sub(z & 1);
62 *previous = previous.wrapping_add(d);
63 Ok(*previous)
64}
65
66#[derive(Default)]
67struct State {

Callers 4

idMethod · 0.70
optional_numberMethod · 0.70
bytesMethod · 0.70
decodeFunction · 0.70

Calls 1

getFunction · 0.70

Tested by

no test coverage detected