blob: 842eb954667a18418dd5dfbc0c5d2440902e3d3b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#pragma once
#include <array>
#include <string>
namespace coding
{
class SHA1
{
public:
static size_t constexpr kHashSizeInBytes = 20;
using Hash = std::array<uint8_t, kHashSizeInBytes>;
static Hash Calculate(std::string const & filePath);
static std::string CalculateBase64(std::string const & filePath);
static Hash CalculateForString(std::string const & str);
// String representation of 40-number hex digit.
static std::string CalculateForStringFormatted(std::string const & str);
static std::string CalculateBase64ForString(std::string const & str);
};
} // coding
|