- The Modern C++ Challenge
- Marius Bancila
- 56字
- 2021-06-25 22:01:28
24. String to binary conversion
Write a function that, given a string containing hexadecimal digits as the input argument, returns a vector of 8-bit integers that represent the numerical deserialization of the string content. The following are examples:
Input: "BAADF00D" or "baadF00D", output: {0xBA, 0xAD, 0xF0, 0x0D}
Input "010203040506", output: {1, 2, 3, 4, 5, 6}