computeIntegrity function
Compute the integrity hash of a Module's canonical proto binary encoding. Returns the hash in the format "sha256:
Implementation
String computeIntegrity(Module module) {
final bytes = module.writeToBuffer();
final digest = sha256.convert(bytes);
return 'sha256:${digest.toString()}';
}