Codechange: make md5sumToString std::string compatible
This commit is contained in:
@@ -612,20 +612,12 @@ int CDECL seprintf(char *str, const char *last, const char *format, ...)
|
||||
|
||||
/**
|
||||
* Convert the md5sum to a hexadecimal string representation
|
||||
* @param buf buffer to put the md5sum into
|
||||
* @param last last character of buffer (usually lastof(buf))
|
||||
* @param md5sum the md5sum itself
|
||||
* @return a pointer to the next character after the md5sum
|
||||
* @return the string representation of the md5sum.
|
||||
*/
|
||||
char *md5sumToString(char *buf, const char *last, const uint8 md5sum[16])
|
||||
std::string MD5SumToString(const uint8 md5sum[16])
|
||||
{
|
||||
char *p = buf;
|
||||
|
||||
for (uint i = 0; i < 16; i++) {
|
||||
p += seprintf(p, last, "%02X", md5sum[i]);
|
||||
}
|
||||
|
||||
return p;
|
||||
return FormatArrayAsHex({md5sum, 16});
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user