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

Method write_bits

nodedb-codec/src/double_delta.rs:64–68  ·  view source on GitHub ↗
(&mut self, value: u64, num_bits: usize)

Source from the content-addressed store, hash-verified

62 }
63
64 pub(crate) fn write_bits(&mut self, value: u64, num_bits: usize) {
65 for i in (0..num_bits).rev() {
66 self.write_bit((value >> i) & 1 == 1);
67 }
68 }
69
70 pub(crate) fn as_bytes(&self) -> &[u8] {
71 &self.buf

Callers 4

encode_dodFunction · 0.80
encodeMethod · 0.80
encode_timestamp_dodMethod · 0.80
encode_value_xorMethod · 0.80

Calls 1

write_bitMethod · 0.80

Tested by

no test coverage detected