aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Loading...
Searching...
No Matches
XXHash.h
Go to the documentation of this file.
1#pragma once
6#include <aws/crt/Exports.h>
7#include <aws/crt/Types.h>
8
9struct aws_xxhash;
10namespace Aws
11{
12 namespace Crt
13 {
14 namespace Checksum
15 {
21 bool AWS_CRT_CPP_API ComputeXXHash64(const ByteCursor &input, ByteBuf &output, uint64_t seed = 0) noexcept;
22
29 ComputeXXHash3_64(const ByteCursor &input, ByteBuf &output, uint64_t seed = 0) noexcept;
30
37 ComputeXXHash3_128(const ByteCursor &input, ByteBuf &output, uint64_t seed = 0) noexcept;
38
45 {
46 public:
47 XXHash(const XXHash &) = delete;
48 XXHash &operator=(const XXHash &) = delete;
49 XXHash(XXHash &&toMove) noexcept = default;
50 XXHash &operator=(XXHash &&toMove) noexcept = default;
51
55 inline int LastError() const noexcept { return m_lastError; }
56
60 static XXHash CreateXXHash64(uint64_t seed = 0, Allocator *allocator = ApiAllocator()) noexcept;
61
65 static XXHash CreateXXHash3_64(uint64_t seed = 0, Allocator *allocator = ApiAllocator()) noexcept;
66
70 static XXHash CreateXXHash3_128(uint64_t seed = 0, Allocator *allocator = ApiAllocator()) noexcept;
71
76 bool Update(const ByteCursor &toHash) noexcept;
77
83 bool Digest(ByteBuf &output) noexcept;
84
85 private:
86 XXHash(aws_xxhash *hash) noexcept;
87 XXHash() = delete;
88
89 ScopedResource<struct aws_xxhash> m_hash;
90 int m_lastError;
91 };
92 } // namespace Checksum
93 } // namespace Crt
94} // namespace Aws
#define AWS_CRT_CPP_API
Definition Exports.h:36
Definition XXHash.h:45
XXHash & operator=(const XXHash &)=delete
XXHash(const XXHash &)=delete
int LastError() const noexcept
Definition XXHash.h:55
XXHash(XXHash &&toMove) noexcept=default
XXHash & operator=(XXHash &&toMove) noexcept=default
bool AWS_CRT_CPP_API ComputeXXHash3_128(const ByteCursor &input, ByteBuf &output, uint64_t seed=0) noexcept
Definition XXHash.cpp:25
bool AWS_CRT_CPP_API ComputeXXHash64(const ByteCursor &input, ByteBuf &output, uint64_t seed=0) noexcept
Definition XXHash.cpp:15
bool AWS_CRT_CPP_API ComputeXXHash3_64(const ByteCursor &input, ByteBuf &output, uint64_t seed=0) noexcept
Definition XXHash.cpp:20
aws_byte_cursor ByteCursor
Definition Types.h:31
aws_allocator Allocator
Definition Allocator.h:14
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition Allocator.cpp:24
aws_byte_buf ByteBuf
Definition Types.h:30
std::unique_ptr< T, std::function< void(T *)> > ScopedResource
Definition Types.h:163
Definition Allocator.h:11