python-varint
python-varint copied to clipboard
encode and decode_bytes function should return the bytes len after write or read
encode and decode function should work like PutVarint and ReadVarint in golang
https://golang.org/pkg/encoding/binary/#PutUvarint
Can you explain what you are trying to do?
encode/decode generally operate directly on binary buffers, which you can presumably len() against. decode_stream() seems to be the only problematic thing, but presumably you can ftell() the fd before and after to see how much data was consumed (though I agree that's pretty crappy)