20 lines
651 B
C
20 lines
651 B
C
|
#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__
|