Per Vognsen on Nostr: It's common to use fixed magic numbers for things like allocation headers/footers to ...
It's common to use fixed magic numbers for things like allocation headers/footers to detect write-clobbering corruption but you can actually do one better with incrementally updatable checksums at a very manageable cost. An intentional field write removes the checksum contribution corresponding to its old value before writing the new value and then it adds in the checksum contribution corresponding to the new value. There's an obvious concurrency issue here, so reason and apply accordingly.
Published at
2023-09-13 13:02:15Event JSON
{
"id": "07a3ac5322567002e3bdb413dd12189700d670061993a0bd060d1421b712c320",
"pubkey": "a297d2ef6a36a76aa5241cfc4c0ab5ab13e37ab15aaa46b48dabd8cc3ace895c",
"created_at": 1694610135,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/users/pervognsen/statuses/111057969841486439",
"activitypub"
]
],
"content": "It's common to use fixed magic numbers for things like allocation headers/footers to detect write-clobbering corruption but you can actually do one better with incrementally updatable checksums at a very manageable cost. An intentional field write removes the checksum contribution corresponding to its old value before writing the new value and then it adds in the checksum contribution corresponding to the new value. There's an obvious concurrency issue here, so reason and apply accordingly.",
"sig": "e067ff0af279600de847f2a6b0e4a465fe9c6e6ef1777e4518747cd9080903c4f6334b538af350139527e722d90f01d61a2a9362ac48ce1c53bd41a29a898511"
}