// Try to calculate a checksum that allows to modify Chrome's bookmarks sS generateChromeBookmarksChecksum(S json) { Map bookmarks = jsonDecodeMap(json); MessageDigest md5 = md5encoder(); embedded void checksum_node(O node) { if (node cast Map) { md5_updateUtf8(md5, (S) node.get("id")); md5.update(toUTF16LE((S) node.get("name"))); if (eq(node.get("type"), "url")) { md5_updateUtf8(md5, "url"); md5_updateUtf8(md5, (S) node.get("url")); } else { md5_updateUtf8(md5, "folder"); fOr (O c : (L) node.get("children")) checksum_node(c); } } } for (S root : splitAtSpace("bookmark_bar other synced")) checksum_node(mapGetMapGet(bookmarks, "roots", root)); ret md5_finish(md5); }