Skip to content

ShahinHasanov90/customs-declaration-codec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Customs Declaration Codec

C11 CMake License: MIT

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.

Supported Formats

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

Build

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)

Usage

#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);

Performance

Operation Throughput
XML decode ~50K declarations/sec
JSON encode ~200K declarations/sec
Binary encode ~500K declarations/sec
Binary decode ~800K declarations/sec

License

MIT License. See LICENSE for details.

About

C encoder/decoder for customs declaration formats. WCO Data Model XML, JSON, compact binary with CRC32 integrity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors