hashEntities<T extends DatumEntity> method
Generates a SHA-256 hash from a list of entities.
The entities are sorted by ID before serialization to ensure a consistent order, resulting in a stable hash for the same set of data.
Implementation
String hashEntities<T extends DatumEntity>(List<T> entities) {
final sorted = List<T>.from(entities)..sort((a, b) => a.id.compareTo(b.id));
final jsonList = sorted.map((e) => e.toDatumMap(target: MapTarget.remote)).toList();
return _hashJson(jsonList);
}