datumEntityDigest function
Computes the canonical 32-byte SHA-256 digest of a single serialized entity
map. Map keys are sorted recursively so the digest is independent of key
insertion order (local vs remote serialization).
Implementation
Uint8List datumEntityDigest(Map<String, dynamic> map) {
final canonical = jsonEncode(_canonicalize(map));
return Uint8List.fromList(sha256.convert(utf8.encode(canonical)).bytes);
}