ubjson / universal-binary-json-java

Universal Binary JSON Java Library
http://ubjson.org
Apache License 2.0
33 stars 4 forks source link

What is in this data? #6

Open dvarrazzo opened 2 years ago

dvarrazzo commented 2 years ago

Looking at the content of this test file:

$ curl -s -L https://github.com/ubjson/universal-binary-json-java/raw/master/src/test/resources/org/ubjson/CouchDB4k.ubj | xxd | head
00000000: 6f09 7305 6461 7461 3373 5e43 6f6c 7265  o.s.data3s^Colre
00000010: 5548 4174 7559 6f55 4f78 314e 345a 6c6f  UHAtuYoUOx1N4Zlo
00000020: 6f75 5174 326f 3675 676e 5554 3665 5974  ouQt2o6ugnUT6eYt
00000030: 5331 3067 7537 6e69 4d38 6930 7645 694e  S10gu7niM8i0vEiN
00000040: 7566 706b 3152 6c4d 5158 6148 586c 4977  ufpk1RlMQXaHXlIw
00000050: 5142 4473 4d46 4446 5551 6346 6567 3276  QBDsMFDFUQcFeg2v
00000060: 5735 6544 3235 3958 6d73 0564 6174 6134  W5eD259Xms.data4
00000070: 736e 7a43 7872 694a 684c 3732 3657 4e4e  snzCxriJhL726WNN
00000080: 5464 4a4a 7a75 7267 5341 3876 4b54 3672  TdJJzurgSA8vKT6r
00000090: 4841 3063 4643 6239 6b6f 5a63 4c55 4d58  HA0cFCb9koZcLUMX

what is the initial o character? It's not in the specs. The py-ubjson library chokes on it:

>>> ubjson1 = requests.get("https://raw.githubusercontent.com/ubjson/universal-binary-json-java/master/src/test/resources/org/ubjson/CouchDB4k.ubj").content

>>> y = ubjson.loadb(ubjson1)
---------------------------------------------------------------------------
DecoderException                          Traceback (most recent call last)
<ipython-input-20-42c4adaf9be8> in <module>
----> 1 y = ubjson.loadb(ubjson1)

DecoderException: ('Invalid marker (at byte 1)', 1)
carllindberg commented 2 years ago

It is data from the older version 8 specification, it looks like.

dvarrazzo commented 2 years ago

Thank you very much. This is confusing as the website makes no mention about versions 8, 12, or which is the current version. It only mentions that 2.0 is in the future...

I've asked for more info at https://github.com/ubjson/universal-binary-json/issues/116.

Cheers!