python-varint icon indicating copy to clipboard operation
python-varint copied to clipboard

encode and decode_bytes function should return the bytes len after write or read

Open phenix3443 opened this issue 7 years ago • 2 comments

encode and decode function should work like PutVarint and ReadVarint in golang

phenix3443 avatar Aug 29 '17 03:08 phenix3443

https://golang.org/pkg/encoding/binary/#PutUvarint

phenix3443 avatar Aug 29 '17 03:08 phenix3443

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)

fmoo avatar Aug 29 '17 18:08 fmoo