RabbitCommon v2.2.6
Loading...
Searching...
No Matches
RabbitCommonEncrypt.h
1/* Copyright Copyright (c) Kang Lin studio, All Rights Reserved
2 * Author Kang Lin <kl222@126.com>
3 */
4
5#ifndef CENCRYPT_H_KL_2021_12_10
6#define CENCRYPT_H_KL_2021_12_10
7
8#pragma once
9
10#include <string>
11#include "rabbitcommon_export.h"
12#include <QString>
13#include <QByteArray>
14
15namespace RabbitCommon {
16
21class RABBITCOMMON_EXPORT CEncrypt
22{
23public:
24 CEncrypt(const char* pszPassword = "RabbitCommon");
25 ~CEncrypt();
26
27 int SetPassword(const char* pszPassword);
34 int Encode(const char* pIn, const int &inLen, char** pOut, int &outLen);
35 int Encode(const QString& szIn, QByteArray& szOut);
42 int Dencode(const char* pIn, const int &inLen, char** pOut, int &outLen);
43 int Dencode(const char* pIn, const int &inLen, std::string &szOut);
44 int Dencode(const QByteArray& szIn, QString& szOut);
45
46private:
47 std::string m_szPassword;
48};
49
50} // namespace RabbitCommon
51#endif // CENCRYPT_H_KL_2021_12_10
52