TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

CBOR – A new object encoding format

24 点作者 eeadc超过 11 年前

7 条评论

unwind超过 11 年前
Gah, that was almost unreadable due to the many typos and inconsistencies. First:<p><i>For example, the number 10 is encoded as 0x10.</i><p>As an example, that is <i>fantastically</i> opaque. It tells me nothing sensible at all, there could just be a magic look-up table that you&#x27;re assumed to know, for all I know. I can&#x27;t draw any conclusions that lead me to believe that CBOR is &quot;simple&quot; from that example.<p>Then, it contradicts the above in the table, where it claims:<p><pre><code> 10 0x0a </code></pre> It also shows bit numbers numbered from 1 to 8, left to right, which is very different from how bits are typically numbered (from 0 to 7, right to left) and thus makes me even <i>more</i> confused.
michaelmior超过 11 年前
I have my own implementation very quickly hacked together for Python3 without tagging support. <a href="https://github.com/michaelmior/pycbor" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;michaelmior&#x2F;pycbor</a><p>The one thing that Flynn seems to be missing is tests. Right now I run tests by parsing the examples from the RFC, so I consider the test suite pretty complete (for the features I have implemented). Glad this got posted since perhaps my test suite could be useful for Flynn.
orclev超过 11 年前
I also have a nearly complete implementation of this in Haskell. <a href="https://github.com/orclev/CBOR" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;orclev&#x2F;CBOR</a><p>The main problem it currently faces is that the encoding&#x2F;decoding support for half-width floats is currently wrong, but so long as you avoid half-width floats it works perfectly.<p>Eventually I want to add support for encoding indefinite lists by way of one of the streaming libraries like conduit or pipes, but before I do that I need to refactor to the code to break the Binary instances out from the types.
评论 #6934014 未加载
goldenkey超过 11 年前
Magic delimiter constants for indefinite lists. Doesn&#x27;t seem like a great implementation when you need hacks like that. Plus the size of individual data elements is restricted by the type&#x2F;length information struct size. JSON is nice because it doesn&#x27;t try to be very efficient, yet it&#x27;s wholly better than XML. This is a binary format, not really comparable considering how restricted this is.
jmspring超过 11 年前
Prior thread -- <a href="https://news.ycombinator.com/item?id=6632576" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6632576</a><p>Not sure why yet another binary encoding method is needed (per editor comments on the original ietf mailing list).
评论 #6934713 未加载
joshu超过 11 年前
This is cool. Are there any numbers on how it compares size&#x2F;speed on some test data structures to msgpack&#x2F;json&#x2F;etc?
waps超过 11 年前
Obligatory <a href="http://xkcd.com/927/" rel="nofollow">http:&#x2F;&#x2F;xkcd.com&#x2F;927&#x2F;</a>