CSV和JSON中的原始二进制漂浮物 - 是否存在这样的标准?
CSV和JSON很棒,因为它们是简单的规格,很容易编写解析器。 (我对CSV和JSON都提出了这个问题,因为我认为没有足够的区别来证明两个单独的问题是合理的。)
这些格式的simpicity的权衡是,整数和浮点数数字尤其比所需的空间更多。例如“ 3.141592653589”是14个字节!这需要额外的空间,并且可以花费精度。
存储ASCII的浮子代表可能会起作用,但会让我感到不安,因为任何字节都可以是逗号或报价标记,打破了解析器。
我很好奇是否有任何解决此问题的JSON和CSV的延伸。
CSV and JSON are great because they're simple specs that are easy to write a parser for. (I ask this question for both CSV and JSON, because I assume there'd not be enough distinction to justify two separate questions.)
A tradeoff of the simpicity in these formats is that integers and floating point numbers especially take more space than needed. E.g. "3.141592653589" is 14 bytes! This takes extra space and can cost precision.
Storing an ASCII representation of the float might work, but makes me feel uneasy, because any byte could be, say, a comma or a quote mark, breaking a parser.
I'm curious if there's any agreed upon extensions to JSON and CSV that addresses this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论