Libraryless. Click here for Pure Java version (4960L/28K).
1 | // Try to calculate a checksum that allows to modify Chrome's bookmarks |
2 | sS generateChromeBookmarksChecksum(S json) {
|
3 | Map bookmarks = jsonDecodeMap(json); |
4 | MessageDigest md5 = md5encoder(); |
5 | |
6 | embedded void checksum_node(O node) {
|
7 | if (node cast Map) {
|
8 | md5_updateUtf8(md5, (S) node.get("id"));
|
9 | md5.update(toUTF16LE((S) node.get("name")));
|
10 | if (eq(node.get("type"), "url")) {
|
11 | md5_updateUtf8(md5, "url"); |
12 | md5_updateUtf8(md5, (S) node.get("url"));
|
13 | } else {
|
14 | md5_updateUtf8(md5, "folder"); |
15 | fOr (O c : (L) node.get("children"))
|
16 | checksum_node(c); |
17 | } |
18 | } |
19 | } |
20 | |
21 | for (S root : splitAtSpace("bookmark_bar other synced"))
|
22 | checksum_node(mapGetMapGet(bookmarks, "roots", root)); |
23 | |
24 | ret md5_finish(md5); |
25 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1027118 |
| Snippet name: | generateChromeBookmarksChecksum [seems to work with Chrome 80] |
| Eternal ID of this version: | #1027118/7 |
| Text MD5: | 12c87075eedd76e7c211a765c78c8672 |
| Transpilation MD5: | 62183852f98a5567bb06fe0b58f58094 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-11-14 19:30:21 |
| Source code size: | 802 bytes / 25 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 657 / 813 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |