Changeset 1029 in SHVCSoftware for branches/SHM-dev/source/Lib/libmd5/MD5.h
- Timestamp:
- 26 Feb 2015, 00:21:54 (10 years ago)
- Location:
- branches/SHM-dev
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev
- Property svn:mergeinfo changed
-
branches/SHM-dev/source
- Property svn:mergeinfo changed
-
branches/SHM-dev/source/Lib/libmd5/MD5.h
r595 r1029 33 33 #pragma once 34 34 #include "libmd5.h" 35 #include <string> 35 36 36 37 //! \ingroup libMD5 37 38 //! \{ 39 40 static const UInt MD5_DIGEST_STRING_LENGTH=16; 38 41 39 42 class MD5 … … 60 63 * flush any outstanding MD5 data, write the digest into digest. 61 64 */ 62 void finalize(unsigned char digest[ 16])65 void finalize(unsigned char digest[MD5_DIGEST_STRING_LENGTH]) 63 66 { 64 67 MD5Final(digest, &m_state); … … 70 73 71 74 72 /**73 * Produce an ascii(hex) representation of picture digest.74 *75 * Returns: a statically allocated null-terminated string. DO NOT FREE.76 */77 inline const char*78 digestToString(const unsigned char digest[3][16], int numChar)79 {80 const char* hex = "0123456789abcdef";81 static char string[99];82 int cnt=0;83 for(int yuvIdx=0; yuvIdx<3; yuvIdx++)84 {85 for (int i = 0; i < numChar; i++)86 {87 string[cnt++] = hex[digest[yuvIdx][i] >> 4];88 string[cnt++] = hex[digest[yuvIdx][i] & 0xf];89 }90 string[cnt++] = ',';91 }92 93 string[cnt-1] = '\0';94 return string;95 }96 75 //! \}
Note: See TracChangeset for help on using the changeset viewer.