trustPolicyFingerprint function
Hashes the source configuration keys and policy values for restore checks.
Source key order is ignored. Policy values must be JSON encodable and retain their order in the fingerprint.
Implementation
String trustPolicyFingerprint(List<String> sourceKeys, List<Object?> policy) {
final sorted = [...sourceKeys]..sort();
return sha256.convert(utf8.encode(jsonEncode([sorted, policy]))).toString();
}