RFoe / coasync

Asynchronous network library that supports coroutines in C++20
https://github.com/RFoe/coasync
MIT License
51 stars 5 forks source link

varint/zigzag 编码需要考虑宿主机字节序 #22

Closed RFoe closed 1 month ago

RFoe commented 1 month ago

https://github.com/RFoe/coasync/blob/42f739f3a10f598837df6367066ce218841f11b2/include/coasync/detail/meta/serde_stream_base.hpp#L241

https://en.cppreference.com/w/cpp/types/endian

enum class endian

{
    little = /*implementation-defined*/,
    big    = /*implementation-defined*/,
    native = /*implementation-defined*/,
};
RFoe commented 1 month ago

varint编码时逐字节处理,不需要考虑字节序