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

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);
    std::vector<uint8_t> hex_string_to_byte(const char* hexString);
}
}

#endif