digestOf static method

String digestOf(
  1. Map<String, Object?> snapshot
)

The digest stamped on a snapshot record: sha256 over the canonical (sorted-key) JSON of snapshot. save stamps it; the restore path recomputes it over whatever is actually on disk, so an edited or planted checkpoint file is rejected instead of restored.

Implementation

static String digestOf(Map<String, Object?> snapshot) =>
    sha256.convert(utf8.encode(jsonEncode(_sorted(snapshot)))).toString();