Skip to content

Commit

Permalink
add note about integrity
Browse files Browse the repository at this point in the history
  • Loading branch information
dcharkes committed Jan 6, 2025
1 parent 6cdcfa5 commit 81961d7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Future<File> downloadAsset(
}

Future<String> hashAsset(File assetFile) async {
// TODO(dcharkes): Should this be a strong hash to not only check for download
// integrity but also safeguard against tampering? This would protected
// against the case where the binary hoster is compromised but pub is not
// compromised.
final fileHash = md5.convert(await assetFile.readAsBytes()).toString();
return fileHash;
}

0 comments on commit 81961d7

Please sign in to comment.