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

Function sign_extend

nodedb-codec/src/gorilla.rs:303–306  ·  view source on GitHub ↗
(value: i64, bits: u32)

Source from the content-addressed store, hash-verified

301}
302
303fn sign_extend(value: i64, bits: u32) -> i64 {
304 let shift = 64 - bits;
305 (value << shift) >> shift
306}
307
308// ---------------------------------------------------------------------------
309// Convenience functions for pure-value encoding (no timestamps)

Callers 1

decode_timestampMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected