TDME2 1.9.121
SHA256.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5
6#include <tdme/tdme.h>
8
9using std::string;
10using std::vector;
11
12/**
13 * SHA256 hash class
14 * @author Andreas Drewke
15 */
17public:
18 /**
19 * @brief Encodes an string to SHA256 string
20 * @param decodedString string to encode
21 * @returns encodedString
22 */
23 inline static const string encode(const string& decodedString) {
24 string encodedString;
25 encode(decodedString, encodedString);
26 return encodedString;
27 }
28
29 /**
30 * Encodes an string to SHA256 string
31 * @param decodedString string to encode
32 * @param encodedString encoded string
33 */
34 static void encode(const string& decodedString, string& encodedString);
35
36 /**
37 * Encodes uint8_t vector to SHA256 string
38 * @param decodedData data to encode
39 * @param encodedString encoded string
40 */
41 static void encode(const vector<uint8_t>& decodedData, string& encodedString);
42
43};
SHA256 hash class.
Definition: SHA256.h:16
static const string encode(const string &decodedString)
Encodes an string to SHA256 string.
Definition: SHA256.h:23