Giter Club home page Giter Club logo

cbor4ii's Introduction

CBOR 0x(4+4)9 0x49

github actions crates license docs.rs

β€œThe Concise Binary Object Representation (CBOR) is a data format whose design goals include the possibility of extremely small code size, fairly small message size, and extensibility without the need for version negotiation.”

see rfc8949

Compatibility

The core mod should be fully compatible with rfc8949, but some extensions will not be implemented in this crate, such as datetime, bignum, bigfloat.

The serde mod defines how Rust types should be expressed in CBOR, which is not any standard, so different crate may have inconsistent behavior.

This library is intended to be compatible with serde_cbor, but will not follow some unreasonable designs of serde_cbor.

  • cbor4ii will express the unit type as an empty array instead of null. This avoids the problem that serde_cbor cannot distinguish between None and Some(()). see pyfisch/cbor#185
  • cbor4ii does not support packed mode, and it may be implemented in future, but it may not be compatible with serde_cbor. If you want packed mode, you should look at bincode.

Performance

It is not specifically optimized for performance in implementation, but benchmarks shows that its performance is slightly better than serde_cbor.

And it supports zero-copy deserialization and deserialize_ignored_any of serde, so in some scenarios it may perform better than crate that do not support such feature.

Robustness

The decode part has been fuzz tested, and it should not crash or panic during the decoding process.

The decode of serde module has a depth limit to prevent stack overflow or OOM caused by specially constructed input. If you want to turn off deep inspection or adjust parameters, you can implement the dec::Read trait yourself.

License

This project is licensed under the MIT license.

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.