Encoder/decoder library for customs declaration data formats. Handles WCO Data Model XML serialization, structured trade message parsing, JSON interchange, and compact binary format. Designed for customs automation systems requiring high-throughput message processing.
| Format | Read | Write | Description |
|---|---|---|---|
| XML | Yes | Yes | WCO Data Model v3.x compliant |
| JSON | Yes | Yes | Internal interchange format |
| Binary | Yes | Yes | Compact format with CRC32 integrity |
| EDIFACT | Yes | No | Segment-level parsing for CUSDEC messages |
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)#include "codec.h"
// Decode XML declaration
declaration_t *decl = codec_decode_xml("declaration.xml");
// Encode to JSON
codec_encode_json(decl, "output.json");
// Compact binary with integrity check
codec_encode_binary(decl, "output.bin");
declaration_destroy(decl);| Operation | Throughput |
|---|---|
| XML decode | ~50K declarations/sec |
| JSON encode | ~200K declarations/sec |
| Binary encode | ~500K declarations/sec |
| Binary decode | ~800K declarations/sec |
MIT License. See LICENSE for details.