Gregory P. Smith added the comment:

Please be constructive.

There is no way to implement generic pickling for hash objects that would work 
across all implementations.  

The underlying code implementing each function is free to store its internal 
state however it wants and does not provide an API to get at it or any standard 
representation of it.

Sure, you could hack things up and allow a specific version and build of 
openssl's EVP hashes to dump their state and restore it for use in another 
process running that same specific version and build of openssl (as would 
likely be the case for multiprocessing use) just as you could for any other 
implementation of a hash function such as the builtin libtomcrypt versions.  
But this is not portable between compilations using different implementations 
of the hash algorithm.  That is not what someone using pickle would ever expect.

Public APIs to access the internal state of hash functions do not exist because 
it is not a common thing for people to do.

hashlib isn't going to support this unless someone contributes a very solid 
patch with tests that handles all of the compatibility issues in a friendly 
maintainable manner.

----------
stage:  -> resolved
type:  -> enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11771>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to