diff options
author | Max Horn | 2007-02-14 21:43:21 +0000 |
---|---|---|
committer | Max Horn | 2007-02-14 21:43:21 +0000 |
commit | 80f799a2b25a5ff353dd572c5aeeb469688102c2 (patch) | |
tree | fdd92f2e9d7213f1c52d76f4f779a012205cf2ec /common/md5.h | |
parent | 8bd1bd53b9ef0b16367a9fe8a986a5ffef17dfe3 (diff) | |
download | scummvm-rg350-80f799a2b25a5ff353dd572c5aeeb469688102c2.tar.gz scummvm-rg350-80f799a2b25a5ff353dd572c5aeeb469688102c2.tar.bz2 scummvm-rg350-80f799a2b25a5ff353dd572c5aeeb469688102c2.zip |
Extended MD5 API a bit: added a variant of md5_file which takes an arbitrary ReadStream; and added md5_file_string methods which directly produce a human readable md5 string (instead of a binary digest)
svn-id: r25592
Diffstat (limited to 'common/md5.h')
-rw-r--r-- | common/md5.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/common/md5.h b/common/md5.h index b4b852b5c6..6700ff355f 100644 --- a/common/md5.h +++ b/common/md5.h @@ -24,21 +24,21 @@ #include "common/scummsys.h" #include "common/fs.h" +#include "common/stream.h" namespace Common { -typedef struct { - uint32 total[2]; - uint32 state[4]; - uint8 buffer[64]; -} md5_context; - -void md5_starts(md5_context *ctx); -void md5_update(md5_context *ctx, const uint8 *input, uint32 length); -void md5_finish(md5_context *ctx, uint8 digest[16]); - bool md5_file(const char *name, uint8 digest[16], uint32 length = 0); bool md5_file(const FilesystemNode &file, uint8 digest[16], uint32 length = 0); +bool md5_file(ReadStream &stream, uint8 digest[16], uint32 length = 0); + +// The following two methods work similar to the above two, but +// instead of computing the binary MD5 digest, they produce +// a human readable lowercase hexstring representing the digest. +bool md5_file_string(const char *name, char md5str[32+1], uint32 length = 0); +bool md5_file_string(const FilesystemNode &file, char md5str[32+1], uint32 length = 0); +bool md5_file_string(ReadStream &stream, char md5str[32+1], uint32 length = 0); + } // End of namespace Common |