Well, it's finally about time to get working on adding Google Chrome support to BookMacster. It appears to be a JSON file, and it looks like Blake Seely's BSJSONAdditions code can read it. Haven't tried writing yet. But I noticed this little "checksum" at the top of the file. For a while, I ignored it, assuming it was part of the JSON standard and would be taken care of by Blake's code. But then a little research showed that it was not. Oh no, do I need to compute that? Disaster. A couple months ago, I had downloaded the Google Chrome source code. It's, I don't know, gigabytes. Took hours. Then it wouldn't build.
Well, I don't really need to build the stupid thing anyhow, just figure out how they do their checksum. So I searched the code for 'checksum' using BBEdit's wonderful Multi-File search. After about 20 minutes, it found 812 occurences of 'checksum'. Damned C++ I haven't used in 5 years. Anyhow, I find the relevant code. I see the algorithms they use, but that's the easy part, since I'm already using these functions in BookMacster for other purposes. The hard part is: exactly what is the payload which is MD5ed? What is the first and last character? Does it include the whitespace? What about text encoding? Big/little-endian? Oh, no; there are 2^N ways to define this.
Studying the damned C++ for a few minutes, it looks like they add in to the checksum the values, and some of the keys, as the JSON nodes are being constructed. Good Grief. Well, it can probably be done. It might be easy, or it might take days, which means a week or more.
Jerry Krinock
UPDATE 2010 April 12. Yes, it was necessary to do the checksum to avoid Google Chrome rewriting the file and changing all the identifiers. But it only took about a day and a half.