MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / zigzag_decode

Function zigzag_decode

nodedb-codec/src/delta.rs:38–40  ·  view source on GitHub ↗
(v: u64)

Source from the content-addressed store, hash-verified

36/// ZigZag-decode an unsigned u64 back to signed i64.
37#[inline]
38fn zigzag_decode(v: u64) -> i64 {
39 ((v >> 1) as i64) ^ -((v & 1) as i64)
40}
41
42/// Write a varint (LEB128-encoded u64) to a buffer.
43fn write_varint(buf: &mut Vec<u8>, mut value: u64) {

Callers 1

decodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected