Files
pilotclient/src/blackmisc/obfuscation.h
Lars Toenning bcc4bdd31e Add SPDX identifiers for REUSE compliance
Co-authored-by: Mat Sutcliffe <oktal3700@gmail.com>
2023-10-03 09:29:49 +02:00

36 lines
1.1 KiB
C++

// SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
//! \file
#ifndef BLACKMISC_OBFUSCATION_H
#define BLACKMISC_OBFUSCATION_H
#include "blackmisc/blackmiscexport.h"
#include <QString>
namespace BlackMisc
{
//! Utility class to obfuscate strings in the source code to make them unreadable.
//! \remark this is no real security, but as the name says just obfuscation. The sole purpose of this class is to remove potentially strings from the source code
class BLACKMISC_EXPORT CObfuscation
{
public:
//! Constructor
CObfuscation() {}
//! Decode string if it has the prefix, otherwise do nothing with it
static QString decode(const QString &inString, bool trimmed = true);
//! Encode string and return with prefix
static QString encode(const QString &inString, bool trimmed = true);
//! Prefix to be used with obfuscated string
static const QString &prefix();
private:
static constexpr quint64 Key = 7234623562;
};
}
#endif // guard