2017-12-15 17:57:42 +00:00
|
|
|
# Perkeep Blob Magic
|
2016-04-26 16:03:41 +00:00
|
|
|
|
|
|
|
[Note: not totally happy with this yet...]
|
|
|
|
|
2017-12-15 17:57:42 +00:00
|
|
|
Ideal Perkeep JSON blobs should begin with the following 15 bytes:
|
2016-04-26 16:03:41 +00:00
|
|
|
|
|
|
|
{"camliVersion"
|
|
|
|
|
|
|
|
However, it's acknowledged that some JSON serialization libraries will format
|
|
|
|
things differently, so additional whitespace should be tolerated.
|
|
|
|
|
2017-12-15 17:57:42 +00:00
|
|
|
An ideal Perkeep serializer will strive for the above header, though, by doing
|
2016-04-26 16:03:41 +00:00
|
|
|
something like:
|
|
|
|
|
|
|
|
- removing the "camliVersion" from the object, noting its value (and requiring
|
|
|
|
it to be present)
|
|
|
|
|
|
|
|
- serializing the JSON with an existing JSON serialization library,
|
|
|
|
|
|
|
|
- removing the serialized JSON's leading "{" character and prepending the 15
|
|
|
|
byte header above, as well as the colon and saved version and comma (which can
|
|
|
|
have whitespace as desired)
|
|
|
|
|