tarsum: allow for generic hashes

Without breaking current and expected TarSum behavior, make the hash used be generic.