mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
27 lines
636 B
C++
27 lines
636 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
namespace wowee {
|
|
namespace auth {
|
|
|
|
class Crypto {
|
|
public:
|
|
static std::vector<uint8_t> sha1(const std::vector<uint8_t>& data);
|
|
static std::vector<uint8_t> sha1(const std::string& data);
|
|
|
|
/**
|
|
* HMAC-SHA1 message authentication code
|
|
*
|
|
* @param key Secret key
|
|
* @param data Data to authenticate
|
|
* @return 20-byte HMAC-SHA1 hash
|
|
*/
|
|
static std::vector<uint8_t> hmacSHA1(const std::vector<uint8_t>& key,
|
|
const std::vector<uint8_t>& data);
|
|
};
|
|
|
|
} // namespace auth
|
|
} // namespace wowee
|