MCPcopy Create free account
hub / github.com/CrowdStrike/csproto / EncodeZigZag64

Function EncodeZigZag64

encoder.go:440–443  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
440func EncodeZigZag64(dest []byte, v int64) int {
441 zz := uint64(v<<1) ^ uint64((v >> 63))
442 return EncodeVarint(dest, zz)
443}

Callers 2

EncodeSInt64Method · 0.85
EncodePackedSInt64Method · 0.85

Calls 1

EncodeVarintFunction · 0.85

Tested by

no test coverage detected