MCPcopy Create free account
hub / github.com/connorjaydunn/BinaryShield / convertToByteVector

Function convertToByteVector

src/util.h:8–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7template <typename T>
8std::vector<BYTE> convertToByteVector(T x)
9{
10 std::vector<BYTE> bytes;
11 size_t byteCount = sizeof(T);
12
13 for (size_t i = 0; i < byteCount; ++i)
14 bytes.push_back((BYTE)((x >> (i * 8)) & 0xFF));
15
16 return bytes;
17}
18
19int getRandomInt(int min, int max);
20

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected