ScreenTranslator/Utils.cpp
2015-10-10 14:45:57 +03:00

14 lines
361 B
C++

#include "Utils.h"
QString encode (const QString &source) {
if (source.isEmpty ()) {
return source;
}
char encKeys[] = {14, 26, 99, 43};
std::string result = source.toStdString ();
for (int i = 0, end = result.size (); i < end; ++i) {
result [i] = result[i] ^ encKeys[ i % sizeof(encKeys)];
}
return QString::fromUtf8 (result.data ());
}