CBOR All In One
CBOR All In One
CBOR / Concise Binary Object Representation / 简洁的二进制对象表示法
CBOR decoder
RFC 8949 Concise Binary Object Representation
“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.”
RFC 8949 简洁二进制对象表示 “简洁二进制对象表示(CBOR)是一种数据格式,其设计目标包括可能极小的代码大小、相当小的消息大小以及无需版本协商即可扩展性。”
Implementations
CBOR is simple enough to implement from scratch for a specific application.
For applications where that is not desirable, generic implementations are available for a variety of platforms. Many of these implementations stay private, but some are published with liberal open-source licenses such as the Apache 2.0 or the MIT license.
Many implementations use a simple API of the form:
encoded = CBOR.encode(data) ➔ data = CBOR.decode(encoded)

CBOR playground
CBOR 與 JSON 在線轉換工具
https://cbor.williamchong.cloud/zh
https://github.com/williamchong/cbor-json-web
demos

// note: a CBOR decoder library is needed here.
const decodedAttestationObject = CBOR.decode(credential.response.attestationObject);
// ❌ Uncaught ReferenceError: CBOR is not defined
console.log(decodedAttestationObject);
(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
Node.js CBOR (npm packages)
AMD ⚠️
https://www.npmjs.com/package/cbor
https://github.com/hildjj/node-cbor

https://www.npmjs.com/package/tinycbor
ESM ✅
https://github.com/hildjj/cbor2
https://www.npmjs.com/package/cbor2
refs
https://www.cnblogs.com/xgqfrms/p/19345585#5393791
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/19347381
未经授权禁止转载,违者必究!

浙公网安备 33010602011771号