libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
sha1.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 SHA1Digest = ByteArray<20>;
23
32SHA1Digest sha1(const void *data, size_t len);
33
43class Sha1 {
44 public:
45 Sha1();
46 ~Sha1();
47
48 Sha1(const Sha1 &) = delete;
49 Sha1 &operator=(const Sha1 &) = delete;
50 Sha1(Sha1 &&) noexcept = default;
51 Sha1 &operator=(Sha1 &&) noexcept = default;
52
54 void update(const void *data, size_t len);
55
57 SHA1Digest finalize();
58
59 private:
60 struct Impl;
61 UniquePtr<Impl> _d;
62};
63
64PROMEKI_NAMESPACE_END
65
66#endif // PROMEKI_ENABLE_CORE