Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thesnowfield/bytelizer
Bytelizer is a binary packaging/unpack library written in modern c, focusing on performance and lightweight.
https://github.com/thesnowfield/bytelizer
c protobuf protocol serialization
Last synced: 7 days ago
JSON representation
Bytelizer is a binary packaging/unpack library written in modern c, focusing on performance and lightweight.
- Host: GitHub
- URL: https://github.com/thesnowfield/bytelizer
- Owner: TheSnowfield
- License: gpl-2.0
- Created: 2024-04-02T05:50:53.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-08-08T23:27:39.000Z (3 months ago)
- Last Synced: 2024-08-10T04:03:34.821Z (3 months ago)
- Topics: c, protobuf, protocol, serialization
- Language: C
- Homepage:
- Size: 73.2 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Bytelizer
Bytelizer is a binary packaging/unpack library written in modern c,
focusing on performance and lightweight.Feature:
- Anchor for late data insert/fill
- Barrier (or segment/packet)
- Length prefix support
- Static Protobuf structure declaration
- EndianessAlmost all functions and variants are macrolized or inlined for compiler static optimization.
[![frost](https://img.shields.io/badge/BYTELIZER-OwO-cea7ff)](#)
[![license](https://img.shields.io/badge/LICENSE-GPLv2-greeen)](./blob/main/LICENSE)## Quick Guide
```c
typedef struct {
uint16_t a;
uint16_t b;
uint32_t c;
} example_t;// the generic way in c
example_t _example = {
.a = 0x1234,
.b = 0x5678,
.c = 0xDEADBEEF
};// the equivalent in bytelizer,
// allocates 64 bytes on the stack.
bytelizer_alloc(_ctx, 64); {
bytelizer_put_uint16(_ctx, 0x1234);
bytelizer_put_uint16(_ctx, 0x5678);
bytelizer_put_uint32(_ctx, 0xDEADBEEF);
}
bytelizer_destroy(_ctx);```
## LICENSE
Licensed under GPLv2 with ❤.