33#include <NDEVR/Buffer.h>
42 template<
class t_hash_type>
57 template <
class t_type,
class t_allocator,
class t_memory_manager>
60 if (buffer.size() == 0)
64 for (
uint04 ii = 0; ii < buffer.size(); ii++)
74 template <
class t_type,
class t_allocator,
class t_memory_manager>
78 for (
uint04 ii = 0; ii < size; ii++)
87 template<
class t_type>
90 if (
sizeof(t_type) ==
sizeof(t_hash_type))
94 else if ((
sizeof(t_type) >
sizeof(t_hash_type)))
96 static const uint04 remainder =
sizeof(t_type) %
sizeof(t_hash_type);
97 static const uint04 num_to_copy =
sizeof(t_type) /
sizeof(t_hash_type);
98 for (
uint04 ii = 0; ii < num_to_copy; ii++)
100 memcpy(&
type_buffer, ((
uint01*)(&
object)) +
sizeof(t_hash_type) * ii,
sizeof(t_hash_type));
105 memcpy(&
type_buffer, ((
uint01*)(&
object)) +
sizeof(t_hash_type) * num_to_copy,
sizeof(remainder));
120 void update(
const t_hash_type& hash_value)
The equivelent of std::vector but with a bit more control.
void update(const Buffer< t_type, t_allocator, t_memory_manager > &buffer)
Updates the checksum by processing all elements in the given buffer.
void update(const t_hash_type &hash_value)
Specialization that directly incorporates a hash-type value into the checksum.
t_hash_type getCheckSum()
Returns the current computed checksum value.
void update(const Buffer< t_type, t_allocator, t_memory_manager > &buffer, uint04 max_size)
Updates the checksum by processing elements in the buffer up to a maximum count.
void update(const t_type &object)
Updates the checksum with a single object by splitting it into hash-type-sized chunks.
t_hash_type type_buffer
Temporary buffer used for copying object data during checksum computation.
CheckSumGenerator()
Constructs a CheckSumGenerator with default initial values.
t_hash_type m_checksum
The running checksum value accumulated from all processed data.
The primary namespace for the NDEVR SDK.
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator Author: Tyler Parke Date: 2017-11-05...
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...