00001 /** 00002 * @copyright 00003 * ==================================================================== 00004 * Copyright (c) 2000-2004 CollabNet. All rights reserved. 00005 * 00006 * This software is licensed as described in the file COPYING, which 00007 * you should have received as part of this distribution. The terms 00008 * are also available at http://subversion.tigris.org/license-1.html. 00009 * If newer versions of this license are posted there, you may use a 00010 * newer version instead, at your option. 00011 * 00012 * This software consists of voluntary contributions made by many 00013 * individuals. For exact contribution history, see the revision 00014 * history and logs, available at http://subversion.tigris.org/. 00015 * ==================================================================== 00016 * @endcopyright 00017 * 00018 * @file svn_md5.h 00019 * @brief Converting and comparing MD5 checksums. 00020 */ 00021 00022 #ifndef SVN_MD5_H 00023 #define SVN_MD5_H 00024 00025 #include <apr_pools.h> 00026 #include <apr_md5.h> 00027 #include "svn_error.h" 00028 #include "svn_pools.h" 00029 00030 #ifdef __cplusplus 00031 extern "C" { 00032 #endif /* __cplusplus */ 00033 00034 00035 00036 /** The MD5 digest for the empty string. */ 00037 const unsigned char *svn_md5_empty_string_digest(void); 00038 00039 00040 /** Return the hex representation of @a digest, which must be 00041 * @c APR_MD5_DIGESTSIZE bytes long, allocating the string in @a pool. 00042 */ 00043 const char *svn_md5_digest_to_cstring_display(const unsigned char digest[], 00044 apr_pool_t *pool); 00045 00046 00047 /** Return the hex representation of @a digest, which must be 00048 * @c APR_MD5_DIGESTSIZE bytes long, allocating the string in @a pool. 00049 * If @a digest is all zeros, then return NULL. 00050 */ 00051 const char *svn_md5_digest_to_cstring(const unsigned char digest[], 00052 apr_pool_t *pool); 00053 00054 00055 /** Compare digests @a d1 and @a d2, each @c APR_MD5_DIGESTSIZE bytes long. 00056 * If neither is all zeros, and they do not match, then return FALSE; 00057 * else return TRUE. 00058 */ 00059 svn_boolean_t svn_md5_digests_match(const unsigned char d1[], 00060 const unsigned char d2[]); 00061 00062 #ifdef __cplusplus 00063 } 00064 #endif /* __cplusplus */ 00065 00066 #endif /* SVN_MD5_H */