diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx index 00f248e109af..db322ada32df 100644 --- a/opencl/source/openclwrapper.cxx +++ b/opencl/source/openclwrapper.cxx @@ -17,11 +17,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include @@ -66,14 +66,12 @@ namespace OString generateMD5(const void* pData, size_t length) { - sal_uInt8 pBuffer[RTL_DIGEST_LENGTH_MD5]; - rtlDigestError aError = rtl_digest_MD5(pData, length, - pBuffer, RTL_DIGEST_LENGTH_MD5); - SAL_WARN_IF(aError != rtl_Digest_E_None, "opencl", "md5 generation failed"); + ::std::vector hash{ + ::comphelper::Hash::calculateHash(pData, length, ::comphelper::HashType::MD5)}; OStringBuffer aBuffer(length * 2); const char* const pString = "0123456789ABCDEF"; - for(sal_uInt8 val : pBuffer) + for(sal_uInt8 val : hash) { aBuffer.append(OStringChar(pString[val/16]) + OStringChar(pString[val%16])); } diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 059406561df5..686ccd52c2f9 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -60,9 +61,6 @@ const char* const publicFunc = #include #include #include - -#include - #include using namespace formula; @@ -2556,12 +2554,11 @@ std::string const & DynamicKernel::GetMD5() { outputstream md5s; // Compute MD5SUM of kernel body to obtain the name - sal_uInt8 result[RTL_DIGEST_LENGTH_MD5]; - rtl_digest_MD5( - mFullProgramSrc.c_str(), - mFullProgramSrc.length(), result, - RTL_DIGEST_LENGTH_MD5); - for (sal_uInt8 i : result) + ::std::vector hash{ + ::comphelper::Hash::calculateHash(mFullProgramSrc.c_str(), + mFullProgramSrc.length(), ::comphelper::HashType::MD5)}; + + for (sal_uInt8 i : hash) { md5s << std::hex << static_cast(i); }