Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::crypto::checksummed_data< DataType > Struct Template Reference

#include <common.hpp>

Public Member Functions

 checksummed_data ()
 

Static Public Member Functions

static auto calculate_checksum (const DataType &data, const char *prefix=nullptr)
 

Public Attributes

uint32_t check = 0
 
DataType data
 

Detailed Description

template<typename DataType>
struct fc::crypto::checksummed_data< DataType >

Definition at line 11 of file common.hpp.

Constructor & Destructor Documentation

◆ checksummed_data()

template<typename DataType >
fc::crypto::checksummed_data< DataType >::checksummed_data ( )
inline

Definition at line 12 of file common.hpp.

12{}

Member Function Documentation

◆ calculate_checksum()

template<typename DataType >
static auto fc::crypto::checksummed_data< DataType >::calculate_checksum ( const DataType & data,
const char * prefix = nullptr )
inlinestatic

Definition at line 16 of file common.hpp.

16 {
17 auto encoder = ripemd160::encoder();
18 raw::pack(encoder, data);
19
20 if (prefix != nullptr) {
21 encoder.write(prefix, const_strlen(prefix));
22 }
23 return encoder.result()._hash[0];
24 }
void pack(Stream &s, const std::deque< T > &value)
Definition raw.hpp:531
constexpr size_t const_strlen(const char *str)
Definition utility.hpp:142
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ check

template<typename DataType >
uint32_t fc::crypto::checksummed_data< DataType >::check = 0

Definition at line 13 of file common.hpp.

◆ data

template<typename DataType >
DataType fc::crypto::checksummed_data< DataType >::data

Definition at line 14 of file common.hpp.


The documentation for this struct was generated from the following file: