All Projects → PJK → Libcbor

PJK / Libcbor

Licence: mit
CBOR protocol implementation for C

Programming Languages

c
50402 projects - #5 most used programming language
c99
33 projects

Projects that are alternatives of or similar to Libcbor

Cbor
CBOR RFC 7049 (Go/Golang) - safe & fast with standard API + toarray & keyasint, CBOR tags, float64/32/16, fuzz tested.
Stars: ✭ 250 (+16.28%)
Mutual labels:  cbor, serialization
Dahomey.Cbor
High-performance CBOR (RFC 7049) serialization framework for .Net (C#)
Stars: ✭ 47 (-78.14%)
Mutual labels:  serialization, cbor
SwiftCBOR
A CBOR implementation for Swift
Stars: ✭ 95 (-55.81%)
Mutual labels:  serialization, cbor
Kotlinx.serialization
Kotlin multiplatform / multi-format serialization
Stars: ✭ 3,550 (+1551.16%)
Mutual labels:  cbor, serialization
cbor-d
Concise Binary Object Representation (CBOR) binary data format for D language
Stars: ✭ 20 (-90.7%)
Mutual labels:  serialization, cbor
Borer
Efficient CBOR and JSON (de)serialization in Scala
Stars: ✭ 131 (-39.07%)
Mutual labels:  cbor, serialization
Gulpio
Binary storage format for deep learning on videos.
Stars: ✭ 178 (-17.21%)
Mutual labels:  serialization
Jsonlab
JSONLab: a native JSON/UBJSON/MassagePack encoder/decoder for MATLAB/Octave
Stars: ✭ 202 (-6.05%)
Mutual labels:  serialization
Qxorm
QxOrm library - C++ Qt ORM (Object Relational Mapping) and ODM (Object Document Mapper) library - Official repository
Stars: ✭ 176 (-18.14%)
Mutual labels:  serialization
Persistentstorageserializable
Swift library that makes easier to serialize the user's preferences (app's settings) with system User Defaults or Property List file on disk.
Stars: ✭ 162 (-24.65%)
Mutual labels:  serialization
Mashumaro
Fast and well tested serialization framework on top of dataclasses
Stars: ✭ 208 (-3.26%)
Mutual labels:  serialization
Dart Json Mapper
Serialize / Deserialize Dart Objects to / from JSON
Stars: ✭ 206 (-4.19%)
Mutual labels:  serialization
Binaryserializer
A declarative serialization framework for controlling formatting of data at the byte and bit level using field bindings, converters, and code.
Stars: ✭ 197 (-8.37%)
Mutual labels:  serialization
Jsons
🐍 A Python lib for (de)serializing Python objects to/from JSON
Stars: ✭ 178 (-17.21%)
Mutual labels:  serialization
Marshmallow Jsonapi
JSON API 1.0 (https://jsonapi.org/) formatting with marshmallow
Stars: ✭ 203 (-5.58%)
Mutual labels:  serialization
Kaml
YAML support for kotlinx.serialization
Stars: ✭ 178 (-17.21%)
Mutual labels:  serialization
Home
A configurable and eXtensible Xml serializer for .NET.
Stars: ✭ 208 (-3.26%)
Mutual labels:  serialization
Aspjson
A fast classic ASP JSON parser and encoder for easy JSON manipulation to work with the new JavaScript MV* libraries and frameworks.
Stars: ✭ 165 (-23.26%)
Mutual labels:  serialization
Rapidyaml
Rapid YAML - a library to parse and emit YAML, and do it fast.
Stars: ✭ 183 (-14.88%)
Mutual labels:  serialization
Store.js
Cross-browser storage for all use cases, used across the web.
Stars: ✭ 13,656 (+6251.63%)
Mutual labels:  serialization

libcbor

Build Status Build status Documentation Status latest packaged version(s) codecov

libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.

Main features

  • Complete RFC conformance
  • Robust C99 implementation
  • Layered architecture offers both control and convenience
  • Flexible memory management
  • No shared global state - threading friendly
  • Proper handling of UTF-8
  • Full support for streams & incremental processing
  • Extensive documentation and test suite
  • No runtime dependencies, small footprint

Getting started

Compile from source

git clone https://github.com/PJK/libcbor
cmake -DCMAKE_BUILD_TYPE=Release -DCBOR_CUSTOM_ALLOC=ON libcbor
make
make install

Homebrew

brew install libcbor

Ubuntu 18.04 and above

sudo add-apt-repository universe
sudo apt-get install libcbor-dev

Fedora & RPM friends

yum install libcbor-devel

Others

Packaged libcbor is available from 15+ major repositories. Click here for more detail

Packaging status

Usage example

#include <cbor.h>
#include <stdio.h>

int main(int argc, char * argv[])
{
	/* Preallocate the map structure */
	cbor_item_t * root = cbor_new_definite_map(2);
	/* Add the content */
	cbor_map_add(root, (struct cbor_pair) {
		.key = cbor_move(cbor_build_string("Is CBOR awesome?")),
		.value = cbor_move(cbor_build_bool(true))
	});
	cbor_map_add(root, (struct cbor_pair) {
		.key = cbor_move(cbor_build_uint8(42)),
		.value = cbor_move(cbor_build_string("Is the answer"))
	});
	/* Output: `length` bytes of data in the `buffer` */
	unsigned char * buffer;
	size_t buffer_size,
		length = cbor_serialize_alloc(root, &buffer, &buffer_size);

	fwrite(buffer, 1, length, stdout);
	free(buffer);

	fflush(stdout);
	cbor_decref(&root);
}

Documentation

Get the latest documentation at libcbor.readthedocs.org

Contributions

All bug reports and contributions are welcome. Please see https://github.com/PJK/libcbor for more info.

Kudos to all the contributors!

License

The MIT License (MIT)

Copyright (c) Pavel Kalvoda, 2014-2020

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].