summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/qa/unit/test_hash.cxx2
-rw-r--r--comphelper/source/misc/docpasswordhelper.cxx14
2 files changed, 8 insertions, 8 deletions
diff --git a/comphelper/qa/unit/test_hash.cxx b/comphelper/qa/unit/test_hash.cxx
index 8b6e5a393d23..0bcc3f8ed56c 100644
--- a/comphelper/qa/unit/test_hash.cxx
+++ b/comphelper/qa/unit/test_hash.cxx
@@ -121,7 +121,7 @@ void TestHash::testSHA512_NoSaltNoSpin()
void TestHash::testSHA512_saltspin()
{
const OUString aHash = comphelper::DocPasswordHelper::GetOoxHashAsBase64( "pwd", "876MLoKTq42+/DLp415iZQ==", 100000,
- comphelper::Hash::IterCount::APPEND, "SHA-512");
+ comphelper::Hash::IterCount::APPEND, u"SHA-512");
CPPUNIT_ASSERT_EQUAL(OUString("5l3mgNHXpWiFaBPv5Yso1Xd/UifWvQWmlDnl/hsCYbFT2sJCzorjRmBCQ/3qeDu6Q/4+GIE8a1DsdaTwYh1q2g=="), aHash);
}
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx
index d528d57e5cbf..4cc0f5c74269 100644
--- a/comphelper/source/misc/docpasswordhelper.cxx
+++ b/comphelper/source/misc/docpasswordhelper.cxx
@@ -260,16 +260,16 @@ std::vector<unsigned char> DocPasswordHelper::GetOoxHashAsVector(
const std::vector<unsigned char>& rSaltValue,
sal_uInt32 nSpinCount,
comphelper::Hash::IterCount eIterCount,
- const OUString& rAlgorithmName)
+ std::u16string_view rAlgorithmName)
{
comphelper::HashType eType;
- if (rAlgorithmName == "SHA-512" || rAlgorithmName == "SHA512")
+ if (rAlgorithmName == u"SHA-512" || rAlgorithmName == u"SHA512")
eType = comphelper::HashType::SHA512;
- else if (rAlgorithmName == "SHA-256" || rAlgorithmName == "SHA256")
+ else if (rAlgorithmName == u"SHA-256" || rAlgorithmName == u"SHA256")
eType = comphelper::HashType::SHA256;
- else if (rAlgorithmName == "SHA-1" || rAlgorithmName == "SHA1") // "SHA1" might be in the wild
+ else if (rAlgorithmName == u"SHA-1" || rAlgorithmName == u"SHA1") // "SHA1" might be in the wild
eType = comphelper::HashType::SHA1;
- else if (rAlgorithmName == "MD5")
+ else if (rAlgorithmName == u"MD5")
eType = comphelper::HashType::MD5;
else
return std::vector<unsigned char>();
@@ -283,7 +283,7 @@ css::uno::Sequence<sal_Int8> DocPasswordHelper::GetOoxHashAsSequence(
const OUString& rSaltValue,
sal_uInt32 nSpinCount,
comphelper::Hash::IterCount eIterCount,
- const OUString& rAlgorithmName)
+ std::u16string_view rAlgorithmName)
{
std::vector<unsigned char> aSaltVec;
if (!rSaltValue.isEmpty())
@@ -303,7 +303,7 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
const OUString& rSaltValue,
sal_uInt32 nSpinCount,
comphelper::Hash::IterCount eIterCount,
- const OUString& rAlgorithmName)
+ std::u16string_view rAlgorithmName)
{
css::uno::Sequence<sal_Int8> aSeq( GetOoxHashAsSequence( rPassword, rSaltValue, nSpinCount,
eIterCount, rAlgorithmName));