fileFor method
Where the file whose SHA-256 is sha256 lives.
Throws ArgumentError unless sha256 is 64 lowercase hex digits.
Implementation
File fileFor(String sha256) {
if (!isSha256Hex(sha256)) {
throw ArgumentError.value(
sha256,
'sha256',
'Not a SHA-256 written as 64 lowercase hex digits.',
);
}
return File('$dir/$sha256.$ext');
}