Changeset 1200 in 3DVCSoftware for branches/HTM-14.1-update-dev0/source/Lib/libmd5
- Timestamp:
- 4 May 2015, 18:38:08 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev0/source/Lib/libmd5/MD5.h
r1179 r1200 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2015, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 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.