summaryrefslogtreecommitdiff
path: root/include/misc.h
blob: cccd830f7e44cbdee45365efd08dfa941b6287c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef MISC_H
#define MISC_H
#include <stdio.h>
#include <string>

namespace nitrokey {
namespace misc {

template <typename T>
typename T::CommandPayload get_payload(){
    //Create, initialize and return by value command payload
    typename T::CommandPayload st;
    bzero(&st, sizeof(st));
    return st;
}


    std::string hexdump(const char *p, size_t size, bool print_header=true);
uint32_t stm_crc32(const uint8_t *data, size_t size);
}
}

#endif