You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
273 B
11 lines
273 B
2 years ago
|
#pragma once
|
||
|
|
||
|
typedef std::vector<char> bytes_vector;
|
||
|
|
||
|
template <typename T>
|
||
|
void pushValue(bytes_vector& vBytes, const T& value) {
|
||
|
for (int i = sizeof(value) - 1; i >= 0; i--) {
|
||
|
const unsigned char byte = (value >> (i * CHAR_BIT)) & 0xFF;
|
||
|
vBytes.push_back(byte);
|
||
|
}
|
||
|
}
|