跳到主要内容

CBOR

  • cbor - Concise Binary Object Representation
    • RFC 8949
    • JSON 的二进制替代
    • 一般会和 JSON 混合使用
  • 适用场景: IoT、SOA、需要性能、需要减少带宽
  • adopted by
    • WebAuthN
    • WebIntegraty
  • cbor.me Online converter
  • Golang - fxamacker/cbor
  • 参考
    • rfc8949 CBOR - Concise Binary Object Representation
    • rfc8610 CDDL - Concise Data Definition Language
    • rfc8152 COSE - CBOR Object Signing and Encryption
    • rfc8392 CWT - CBOR Web Token
Major TypeMeaningContent
0unsigned integer N-
1negative integer -1-N-
2byte stringN bytes - base64url - wo pad
3text stringN bytes (UTF-8 text)
4arrayN data items (elements)
5map2N data items (key/ value pairs)
6tag of number N1 data item
7simple/float-