MCPcopy
hub / github.com/golang/protobuf / EncodeZigzag64

Method EncodeZigzag64

proto/buffer.go:151–153  ·  view source on GitHub ↗

EncodeZigzag64 appends a 64-bit zig-zag varint encoding to the buffer.

(v uint64)

Source from the content-addressed store, hash-verified

149
150// EncodeZigzag64 appends a 64-bit zig-zag varint encoding to the buffer.
151func (b *Buffer) EncodeZigzag64(v uint64) error {
152 return b.EncodeVarint(uint64((uint64(v) << 1) ^ uint64((int64(v) >> 63))))
153}
154
155// EncodeFixed32 appends a 32-bit little-endian integer to the buffer.
156func (b *Buffer) EncodeFixed32(v uint64) error {

Callers 1

TestNumericPrimitivesFunction · 0.80

Calls 1

EncodeVarintMethod · 0.95

Tested by 1

TestNumericPrimitivesFunction · 0.64