(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=43508061

Chaosvex 在 Hacker News 上发布了“Show HN: Hexi”,这是一个新的仅包含头文件的 C++ 网络二进制序列化库。Hexi旨在提供一个轻量级、高性能且安全的网络协议序列化和反序列化解决方案。作者发现现有库过于笨重、速度慢或过于抽象,因此创建了 Hexi。其主要特性包括:高效的字节操作,零分配和复制能力;针对恶意数据和编码错误的安全机制;以及易于集成到项目中。该库自包含,仅需标准库,并设计用于快速原型设计和生产使用。作者希望它能帮助其他需要快速便捷处理二进制数据的开发者。


原文
Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Hexi, modern header-only network binary serialisation for C++ hackers (github.com/emberemu)
6 points by Chaosvex 22 minutes ago | hide | past | favorite | discuss
Over the last few years, I've needed an easy way to quickly serialise and deserialise various network protocols safely and efficiently. Most of the libraries that existed at the time were either quite heavy, had less than stellar performance, or were an abstraction level above what I was looking for.

I decided to put together my own class to do the job, starting with an easy, low-overhead way to move bytes in and out of arbitrary buffers. Along the way, it picked up useful bits and pieces, such as buffer structures and allocators that made the byte shuffling faster, often being able to do it with zero allocations and zero copies. Safety features came along to make sure that malicious packet data or mistakes in the code wouldn't result in segfaults or vulnerabilities.

It's become useful enough to me that I've packaged it up in its own standalone library on the chance that it might be useful to others. It has zero dependencies other than the standard library and has been designed for quick integration into any project within minutes, or seconds with a copy paste of the amalgamated header. It can be used in production code but it's also ideal for for those that want to quickly hack away at binary data with minimal fuss.











Join us for AI Startup School this June 16-17 in San Francisco!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact



Search:
联系我们 contact @ memedata.com