RKrahl / archive-tools

Tools for managing archives
Apache License 2.0
1 stars 2 forks source link

Make the checksum algorithm configurable #69

Open RKrahl opened 2 years ago

RKrahl commented 2 years ago

In principle, archive-tools is capable to deal with archives using any checksum algorithm supported by hashlib.new(). it can list the content, verify the checksums and also create them. But there is no option to select the checksum algorithm to be used on create, neither in the API, in the Archive.create() call, nor as a command line option for archive-tool create.

The only way is to set a class attribute in archive.manifest.FileInfo:

from pathlib import Path
from archive.archive import Archive
import archive.manifest

archive.manifest.FileInfo.Checksums = ['md5', 'blake2b']

Archive().create(Path("data.tar.gz"), paths=[Path("data")])

There should be a corresponding option, both in the API and the command line.