clbarnes / recursum

Rust script to quickly hash all files in a directory tree
MIT License
6 stars 1 forks source link

Customisable hashers #3

Open clbarnes opened 4 years ago

clbarnes commented 4 years ago

See https://github.com/clbarnes/recursum/tree/multihasher .

Anything which supports digest::Digest should be fine. However, that means functions returning Box<dyn Digest>, which may not be ideal.

Alternatively, implement Digest on an enum which just delegates to different types.

clbarnes commented 3 years ago

See uutils' hashsum.

i.e. Box::new(Md5::new()) as Box<dyn Digest>