RFC8949을 준수하는 CBOR(간결한 바이너리 객체 표현) 데이터를 인코딩하고 디코딩하기 위한 Dart 라이브러리입니다. 구조화된 데이터를 효율적으로 작고 컴팩트한 바이너리 형식으로 시리얼라이즈할 수 있으며, 대역폭과 성능이 중요한 IoT, 모바일 및 웹 애플리케이션에 적합합니다. 이 패키지는 모든 표준 CBOR 유형을 지원하며 Dart 생태계와 원활하게 통합됩니다.
This package provides an encoding/decoding package for the Concise Binary Object
Representation as documented in RFC8949.
CBOR is increasingly used as a line protocol in the IOT world where the overhead
of transmitting JSON on constrained devices can be large in packet size and
processing overheads.
Features
Streamlined encoding and decoding of CBOR, including indefinite length and
streamed decoding.
Set of types that semantically handles types, nesting, and tags.
Automatic conversion for the smallest size needed for integers.
Automatic conversion for the smallest precision needed for floating point
numbers.
Any value can be the key for a map.
Optional simple API for encoding and decoding directly to Dart objects.
Pretty-printing and conversion to JSON.
Rational numbering encoding is supported on tag 30.
Usage
Two APIs are provided, cbor.dart and simple.dart.
cbor.dart
Encodes from CborValue and decodes to CborValue.
The CborValue contains the tags for this item, and its subtypes are used to
identify the type and tags for the item. This allows one to handle information
encoded in a more lossless way.
Inheritance tree for CborValue looks something like this: