Skip to content

Commit 46a0076

Browse files
committed
docs: checksum
1 parent 098a01d commit 46a0076

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pages/docs/tutorial/get_started.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ const bytes = doc.export({ mode: "snapshot" });
166166
// Bytes can be saved to local storage, database, or sent over the network
167167
```
168168

169+
Snapshots and updates include a checksum in their headers, so any corruption from storage or transmission (like bit flips) is detected during import before it can affect your document.
170+
169171
Loading your app state:
170172

171173
```ts no_run twoslash

pages/docs/tutorial/persistence.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ To achieve both quick saves and resource efficiency:
2121
keystroke or with debounce/throttle). Store these binary data in fast-write
2222
storage like user disks or a key-value database. This ensures quick saves with
2323
low resource cost.
24+
- Loro validates the checksum embedded in every snapshot/update header during import, so corrupted binary payloads (for example, from bit flips in queues or object storage) are rejected before they touch your document state.
2425
- When loading a document, import the snapshot and all related updates to get
2526
the latest version.
2627
- After importing, export a new snapshot to replace the old one and remove

0 commit comments

Comments
 (0)