MCPcopy Create free account
hub / github.com/davidblewett/rure-python / read_vari32

Function read_vari32

regex/src/dfa.rs:1881–1888  ·  view source on GitHub ↗

https://developers.google.com/protocol-buffers/docs/encoding#varints

(data: &[u8])

Source from the content-addressed store, hash-verified

1879
1880/// https://developers.google.com/protocol-buffers/docs/encoding#varints
1881fn read_vari32(data: &[u8]) -> (i32, usize) {
1882 let (un, i) = read_varu32(data);
1883 let mut n = (un >> 1) as i32;
1884 if un & 1 != 0 {
1885 n = !n;
1886 }
1887 (n, i)
1888}
1889
1890/// https://developers.google.com/protocol-buffers/docs/encoding#varints
1891fn write_varu32(data: &mut Vec<u8>, mut n: u32) {

Callers 2

nextMethod · 0.85
pFunction · 0.85

Calls 1

read_varu32Function · 0.85

Tested by

no test coverage detected