Kylin/Encrypt/Encrypt.h
2024-08-16 11:41:24 +08:00

20 lines
653 B
C++

#ifndef __ENCRYPT_H__
#define __ENCRYPT_H__
#include <string>
#include <string_view>
#include <vector>
class Encrypt {
public:
using Sha1DigestType = unsigned char[20];
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__