[issue10302] Add class-functions to hash many small objects with hashlib

2010-11-05 Thread Gregory P. Smith
Gregory P. Smith added the comment: This is an application specific optimization that I'd like to see as its own library or a feature added to NSS or OpenSSL. Regardless if you want this for python, write an extension module and put it on pypy before aiming for the stdlib. I understand the o

[issue10302] Add class-functions to hash many small objects with hashlib

2010-11-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Overlord Antoine ;-) The API of "hashfunc *files" looks like something that should be done at the command line in bash. For the most part, I think users are better-off using normal Python loops so they can do something with the computed has

[issue10302] Add class-functions to hash many small objects with hashlib

2010-11-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Thanks for your comment; it is a very valid point to consider. > However, as a vector-based implementation is roughly three to four > times faster than what the current API can provide by design (reduced > overhead and GIL-relaxation not included), I may disa

[issue10302] Add class-functions to hash many small objects with hashlib

2010-11-04 Thread Lukas Lueg
Lukas Lueg added the comment: Thanks for your comment; it is a very valid point to consider. However, as a vector-based implementation is roughly three to four times faster than what the current API can provide by design (reduced overhead and GIL-relaxation not included), I may disagree with

[issue10302] Add class-functions to hash many small objects with hashlib

2010-11-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: This sounds dangerously like a micro-optimization to me, and I'm not sure an additional API is ok for that. -- nosy: +gregory.p.smith, pitrou ___ Python tracker _

[issue10302] Add class-functions to hash many small objects with hashlib

2010-11-03 Thread Lukas Lueg
New submission from Lukas Lueg : The objects provided by hashlib mainly serve the purpose of computing hashes over strings of arbitrary size. The user gets a new object (e.g. hashlib.sha1()), calls .update() with chunks of data and then finally uses .digest() or .hexdigest() to get the hash. F