19 #ifndef avro_Encoding_hh__
20 #define avro_Encoding_hh__
32 AVRO_DECL constexpr uint64_t encodeZigzag64(int64_t input) noexcept {
34 return ((input << 1) ^ (input >> 63));
36 AVRO_DECL constexpr int64_t decodeZigzag64(uint64_t input) noexcept {
37 return static_cast<int64_t
>(((input >> 1) ^ -(
static_cast<int64_t
>(input) & 1)));
40 AVRO_DECL constexpr uint32_t encodeZigzag32(int32_t input) noexcept {
42 return ((input << 1) ^ (input >> 31));
44 AVRO_DECL constexpr int32_t decodeZigzag32(uint32_t input) noexcept {
45 return static_cast<int32_t
>(((input >> 1) ^ -(
static_cast<int64_t
>(input) & 1)));
48 AVRO_DECL
size_t encodeInt32(int32_t input, std::array<uint8_t, 5> &output) noexcept;
49 AVRO_DECL
size_t encodeInt64(int64_t input, std::array<uint8_t, 10> &output) noexcept;