Skip to content

Commit 0db86d4

Browse files
committed
Fix Base64decode/Base64encode not working correctly on binary data
1 parent ae16a58 commit 0db86d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Shared/sdk/SharedUtil.Crypto.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ namespace SharedUtil
1515
inline SString Base64encode(const SString& data)
1616
{
1717
SString result;
18-
CryptoPP::StringSource ss(data.c_str(), true, new CryptoPP::Base64Encoder(new CryptoPP::StringSink(result), false)); // Memory is freed automatically
18+
CryptoPP::StringSource ss(data, true, new CryptoPP::Base64Encoder(new CryptoPP::StringSink(result), false)); // Memory is freed automatically
1919

2020
return result;
2121
}
2222

2323
inline SString Base64decode(const SString& data)
2424
{
2525
SString result;
26-
CryptoPP::StringSource ss(data.c_str(), true, new CryptoPP::Base64Decoder(new CryptoPP::StringSink(result))); // Memory is freed automatically
26+
CryptoPP::StringSource ss(data, true, new CryptoPP::Base64Decoder(new CryptoPP::StringSink(result))); // Memory is freed automatically
2727

2828
return result;
2929
}

0 commit comments

Comments
 (0)