EncodeZigZag64 encodes v into dest using the Protobuf zig/zag encoding for more efficient encoding of negative numbers, and returns the number of bytes written.
(dest []byte, v int64)
| 438 | // EncodeZigZag64 encodes v into dest using the Protobuf zig/zag encoding for more efficient encoding |
| 439 | // of negative numbers, and returns the number of bytes written. |
| 440 | func EncodeZigZag64(dest []byte, v int64) int { |
| 441 | zz := uint64(v<<1) ^ uint64((v >> 63)) |
| 442 | return EncodeVarint(dest, zz) |
| 443 | } |
no test coverage detected