OCFL / ocfl-java

A Java OCFL implementation
MIT License
16 stars 12 forks source link

size digest algorithm #117

Open rsteph-de opened 1 week ago

rsteph-de commented 1 week ago

These are the necessary modifications to store the file size as fixity in ocfl-inventory.json.

The use of the standardJavaName is now a little bit awkward because the calculation of the size as digest is no Java standard MessageDigest. Maybe this could be improved later. Currently I did not want to break the API, because I am not sure about any possible side effects

pwinckles commented 1 week ago

Thanks, I'll look at this over the weekend.

pwinckles commented 6 days ago

@rsteph-de I opened a PR against your branch: https://github.com/rsteph-de/ocfl-java/pull/1

The changes are more extensive than your PR mainly because I moved the DigestAlgorithm constants out of DigestAlgorithm and into DigestAlgorithmRegistry, which is a breaking change.

Functionality wise, there are two differences.

  1. The size is always encoded without the leading zero
  2. The file size is read directly in OcflObjectUpdater.addFileFixity(), without requiring that the file is read again.