Changeset 608 in 3DVCSoftware for trunk/source/Lib/libmd5/MD5.h
- Timestamp:
- 1 Sep 2013, 22:47:26 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/libmd5/MD5.h
r56 r608 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 37 37 //! \{ 38 38 39 class MD5 { 39 class MD5 40 { 40 41 public: 41 42 /** … … 68 69 }; 69 70 71 70 72 /** 71 * Produce an ascii(hex) representation of the 128bitdigest.73 * Produce an ascii(hex) representation of picture digest. 72 74 * 73 75 * Returns: a statically allocated null-terminated string. DO NOT FREE. 74 76 */ 75 77 inline const char* 76 digestToString( unsigned char digest[16])78 digestToString(const unsigned char digest[3][16], int numChar) 77 79 { 78 80 const char* hex = "0123456789abcdef"; 79 static char string[33]; 80 for (int i = 0; i < 16; i++) 81 static char string[99]; 82 int cnt=0; 83 for(int yuvIdx=0; yuvIdx<3; yuvIdx++) 81 84 { 82 string[i*2+0] = hex[digest[i] >> 4]; 83 string[i*2+1] = hex[digest[i] & 0xf]; 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++] = ','; 84 91 } 92 93 string[cnt-1] = '\0'; 85 94 return string; 86 95 }
Note: See TracChangeset for help on using the changeset viewer.