Skip to content

Bytelizer is a binary packaging/unpack library written in modern c, focusing on performance and lightweight.

License

Notifications You must be signed in to change notification settings

TheSnowfield/bytelizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  • Endianess

Almost all functions and variants are macrolized or inlined for compiler static optimization.

frost license

Quick Guide

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 ❤.

About

Bytelizer is a binary packaging/unpack library written in modern c, focusing on performance and lightweight.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published