载入中...
搜索中...
未找到
HashFunction.h
浏览该文件的文档.
1
2
3#pragma once
4
5#include "common/Data.h"
6#include <cstdint>
7#include <string>
8
9namespace eve
10{
11namespace data
12{
13
15{
16public:
17
18 struct Value
19 {
20 char data[64]; // Maximum possible size (SHA512).
21 size_t size;
22 };
23
39 static HashFunction *getHashFunction(std::string function);
40
41 virtual ~HashFunction() {}
42
51 virtual void hash(std::string function, const char *input, uint64_t length, Value &output) const = 0;
52
57 virtual bool isSupported(std::string function) const = 0;
58
59protected:
60
62
63}; // HashFunction
64
65} // data
66} // eve
Light2D::Data * data
static HashFunction * getHashFunction(std::string function)
Get a HashFunction instance for the given function.
virtual bool isSupported(std::string function) const =0
virtual void hash(std::string function, const char *input, uint64_t length, Value &output) const =0
Hash the input, producing an set of bytes as output.
Definition Build.cpp:11