libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
sha2.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_CORE
13#include <cstdint>
14#include <cstddef>
15#include <promeki/namespace.h>
16#include <promeki/bytearray.h>
17#include <promeki/uniqueptr.h>
18
19PROMEKI_NAMESPACE_BEGIN
20
22using SHA256Digest = ByteArray<32>;
23
37SHA256Digest sha256(const void *data, size_t len);
38
58class Sha256 {
59 public:
60 Sha256();
61 ~Sha256();
62
63 Sha256(const Sha256 &) = delete;
64 Sha256 &operator=(const Sha256 &) = delete;
65 Sha256(Sha256 &&) noexcept = default;
66 Sha256 &operator=(Sha256 &&) noexcept = default;
67
72 void update(const void *data, size_t len);
73
81 SHA256Digest finalize();
82
83 private:
84 struct Impl;
85 UniquePtr<Impl> _d;
86};
87
88PROMEKI_NAMESPACE_END
89
90#endif // PROMEKI_ENABLE_CORE