Kylin/Encrypt/Encrypt.h

20 lines
651 B
C
Raw Normal View History

2023-08-01 13:54:17 +08:00
#ifndef __ENCRYPT_H__
#define __ENCRYPT_H__
#include <string>
#include <string_view>
#include <vector>
class Encrypt {
public:
using Sha1DigestType = unsigned int[5];
static std::string encode64(const char *data, size_t size);
static std::string encode64(const std::string_view &data);
static std::string decode64(const std::string_view &data);
static std::string sha1sum(const std::string_view &data, Sha1DigestType &digest);
static std::string sha1sum(const std::vector<char> &data, Sha1DigestType &digest);
static std::string sha1sum(const char *data, size_t size, Sha1DigestType &digest);
};
#endif // __ENCRYPT_H__