Changeset 1313 in 3DVCSoftware for trunk/source/Lib/libmd5/MD5.h


Ignore:
Timestamp:
13 Aug 2015, 17:38:13 (9 years ago)
Author:
tech
Message:

Merged 14.1-update-dev1@1312.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/libmd5/MD5.h

    r1179 r1313  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    6 * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    3333#pragma once
    3434#include "libmd5.h"
     35#include <string>
    3536
    3637//! \ingroup libMD5
    3738//! \{
     39
     40static const UInt MD5_DIGEST_STRING_LENGTH=16;
    3841
    3942class MD5
     
    6063   * flush any outstanding MD5 data, write the digest into digest.
    6164   */
    62   void finalize(unsigned char digest[16])
     65  void finalize(unsigned char digest[MD5_DIGEST_STRING_LENGTH])
    6366  {
    6467    MD5Final(digest, &m_state);
     
    7073
    7174
    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 }
    9675//! \}
Note: See TracChangeset for help on using the changeset viewer.