HomeSoftware Heritage

hashutil: Improve MultiHash class from_* to compute hashes

Description

hashutil: Improve MultiHash class from_* to compute hashes

This allows calls like:

  • MultiHash.from_file(file_object).digest()
  • MultiHash.from_path(b'foo').hexdigest()
  • MultiHash.from_data(b'foo').bytehexdigest()

Details

Provenance
ardumontAuthored on Sep 15 2018, 12:35 AM
ardumontPushed on Sep 17 2018, 12:07 PM
Differential Revision
D410: model.hashutil: Open new endpoint to allow to hash stream
Parents
rDMOD836198c41169: swh.model.hashutil: Remove unnecessary endpoints
Branches
Unknown
Tags
Unknown