Add option to choose hash type used.
This adds an option to duperemove (and csum-test), '--hash=' which allows the user to pick which algorithm is used for hashing blocks. Internally we make a hash_module structure which holds function pointers to the various hashing operations as well pointers to friendly and internal names. The init_hash() function is changed to take a string and will choose the module structure whose hash name matches that string. Aside from defining a module structure, the changes to each hash module c file are minimal - renaming functions and variables so we don't clash. Signed-off-by: Mark Fasheh <firstname.lastname@example.org>
Showing with 304 additions and 122 deletions