Calculate MD5 hashes for strings and files.
After creating an object of this type, call update() with your input data as argument, as often as needed. Then, call final_hex() or final_digest() to obtain the hash as either a hex string or a DigestType object and reset the object for reuse.
If you simply need the hash for a string or content of a file, use read_hex() or read_digest(), which are static shortcuts for the above using an input source. Use functions such as utils::from_file() and utils::from_string() to conveniently get an input source that can be used here.
The implementation is based on http://www.zedwood.com/article/cpp-md5-function, which itself was converted to C++ class by Frank Thilo (thilo.nosp@m.@uni.nosp@m.x-ag..nosp@m.org) for bzflag (http://www.bzflag.org), and is based on the reference implementation of RFC 1321
:
License
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved.
License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software or this function.
License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this documentation and/or software.
See also Acknowledgements.
Definition at line 88 of file md5.hpp.