-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom MD5/SHA256 hasher option #1283
Add custom MD5/SHA256 hasher option #1283
Conversation
Since there is no cleanup for the API clients using the SIMD MD5 needs to be up to the API users to manage. Provide a function that allows to insert a custom hasher. md5-simd package is only used to provide the interface, by default a wrapper for "crypto/md5" is created, so default performance remains unaffected.
Bonus changes: * Compress output a bit better * Clean up put options * Move `disable-multipart` to IO options * Add comment value for CSV input, so we can add stuff like cmdline to output later. Waiting for minio/minio-go#1283
Code looks good, but need to sort of the md5-simd buffer copy issue first. |
Do we need it anymore? @klauspost |
* Allow custom sha256. * Add a pool for sha256 and md5 and reuse them.
@harshavardhana I have kept the default to be a wrapped stdlib, but added a wrapper that will allow reuse of the hashers. I think this will be a fine improvement and it gives the flexibility to override them on clients. |
PTAL @fwessels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Since there is no cleanup for the API clients using the SIMD MD5 needs to be up to the API users to manage.
Provide a function that allows to insert a custom hasher for MD5 and SHA256.
We keep using the same for both, but by default we allow to reuse the hashers.