Giter Site home page Giter Site logo

ratandc2-features / packer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from souzomain/packer

0.0 0.0 0.0 45 KB

Packer is a compact, fast and crosss-platform serialization library for store data in a buffer

License: MIT License

Python 17.06% C 67.95% Go 14.98%

packer's Introduction

Overview

Simple, fast and Light-weigh, Packer is a crosss-platform serialization C library.

The packer library, works on several projects. You can build your protocol in an easy way using the packer!

example:

PPACKER protocol = packer_init();
packer_add_data(protocol, information, sizeof(information));
send(fd, packer_get_buffer(protocol), packer_get_size(protocol), 0);
packer_free(protocol);

and, you can get values stored in a buffer

example:

recv(fd, buffer, size, 0);
size_t offset = 0;
char *value1 = packer_get_string(buffer, &offset);
int value2 = packer_get_int32(buffer, &offset);
void *value3 = packer_get_data(buffer, value2, &offset);

You can find more examples in example folder.

  • cross-platform

Compilation

you can compile using gcc or any other C/C++ compiler.

example: gcc yourfile.c Packer.c

Simple!

Python support

This serialization library have python support and other languages

from Packer import Packer, Parser

packer = Packer()
packer.add_str("hello world")

print(f"packet size: {len(packer)} | packet: {packer.buffer}")

parser = Parser(packer.buffer)
print(parser.parse_str())

more examples from other languages in language you choice folder

Thanks

Thanks to the Havoc Framework and its contributors, this repository is wonderful!

packer's People

Contributors

souzomain avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.