[issue45150] Add a file_digest() function in hashlib

2022-03-22 Thread Christian Heimes
Christian Heimes added the comment: New changeset e03db6d5be7cf2e6b7b55284985c404de98a9420 by Christian Heimes in branch 'main': bpo-45150: Fix testing under FIPS mode (GH-32046) https://github.com/python/cpython/commit/e03db6d5be7cf2e6b7b55284985c404de98a9420 -- __

[issue45150] Add a file_digest() function in hashlib

2022-03-22 Thread Christian Heimes
Change by Christian Heimes : -- pull_requests: +30136 pull_request: https://github.com/python/cpython/pull/32046 ___ Python tracker ___

[issue45150] Add a file_digest() function in hashlib

2022-03-22 Thread miss-islington
miss-islington added the comment: New changeset 4f97d64c831c94660ceb01f34d51fa236ad968b0 by Christian Heimes in branch 'main': bpo-45150: Add hashlib.file_digest() for efficient file hashing (GH-31930) https://github.com/python/cpython/commit/4f97d64c831c94660ceb01f34d51fa236ad968b0 ---

[issue45150] Add a file_digest() function in hashlib

2022-03-16 Thread Aur Saraf
Aur Saraf added the comment: I don't think HMAC of a file is a common enough use case to support, but I have absolutely no problem conceding this point, the cost of supporting it is very low. I/O in C is a world of pain in general. In the specific case of `io.RawIOBase` objects (non-buffere

[issue45150] Add a file_digest() function in hashlib

2022-03-16 Thread Christian Heimes
Change by Christian Heimes : -- pull_requests: +30021 pull_request: https://github.com/python/cpython/pull/31930 ___ Python tracker ___

[issue45150] Add a file_digest() function in hashlib

2022-03-16 Thread Christian Heimes
Christian Heimes added the comment: Before we continue hacking on an implementation, let's discuss some API design. - Multiple functions or multiple dispatch (name, fileobj) are confusing to users. Let's keep it simple and only implement one function that operates on file objects. - The fun

[issue45150] Add a file_digest() function in hashlib

2022-03-15 Thread Aur Saraf
Aur Saraf added the comment: Added an attempt to handle signals. I don't think it's working, because when I press Ctrl+C while hashing a long file, it only raises KeyboardInterrupt after waiting the amount of time it usually takes the C code to return, but maybe that's not a good test?

[issue45150] Add a file_digest() function in hashlib

2022-03-15 Thread Aur Saraf
Aur Saraf added the comment: Forgot an important warning: this is the first time I write C code against the Python API, and I didn't thoroughly read the guide (or at all, to be honest). I think I did a good job, but please suspect my code of noob errors. I'm especially not confident that it'

[issue45150] Add a file_digest() function in hashlib

2022-03-15 Thread Aur Saraf
Aur Saraf added the comment: The rationale behind `from_raw_file()` and the special treatment of non-buffered IO is that there is no `read_buffer()` API or other clean way to say "I want to read just what's currently in the buffer so that from now on I could read directly from the file descr

[issue45150] Add a file_digest() function in hashlib

2022-03-15 Thread Aur Saraf
Aur Saraf added the comment: PR contains a draft implementation, would appreciate some review before I implement the same interface on all builtin hashes as well as OpenSSL hashes. -- ___ Python tracker ___

[issue45150] Add a file_digest() function in hashlib

2022-03-15 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +30019 pull_request: https://github.com/python/cpython/pull/31928 ___ Python tracker ___ ___

[issue45150] Add a file_digest() function in hashlib

2022-03-14 Thread Aur Saraf
Aur Saraf added the comment: OK, I'll give it a go. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue45150] Add a file_digest() function in hashlib

2022-03-14 Thread Tarek Ziadé
Tarek Ziadé added the comment: @Aur, go for it, I started to implement it and got lost into the details for each backend.. -- ___ Python tracker ___ __

[issue45150] Add a file_digest() function in hashlib

2022-03-14 Thread Aur Saraf
Aur Saraf added the comment: Tarek, Are you still working on this? Would you like me to take over? Aur -- nosy: +Aur.Saraf ___ Python tracker ___ ___

[issue45150] Add a file_digest() function in hashlib

2021-09-09 Thread Tarek Ziadé
Tarek Ziadé added the comment: Hey Christian, I hope things are well for you! Thanks for all the precious feedback, I'll rework the patch accordingly -- ___ Python tracker ___

[issue45150] Add a file_digest() function in hashlib

2021-09-09 Thread Christian Heimes
Christian Heimes added the comment: Hey Tarek, long time no see! * the _sha256 module is optional, can be disabled and is not available in some distributions. * I also don't like to use sha256 has default. It's slow, even slower than sha512. Any default makes it also harder to upgrade to a

[issue45150] Add a file_digest() function in hashlib

2021-09-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +christian.heimes, gregory.p.smith type: -> enhancement versions: +Python 3.11 ___ Python tracker ___ ___

[issue45150] Add a file_digest() function in hashlib

2021-09-09 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +26673 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28252 ___ Python tracker _

[issue45150] Add a file_digest() function in hashlib

2021-09-09 Thread Tarek Ziadé
New submission from Tarek Ziadé : I am proposing the addition of a very simple helper to return the hash of a file. -- assignee: tarek components: Library (Lib) messages: 401457 nosy: tarek priority: normal severity: normal status: open title: Add a file_digest() function in hashlib __