This code converts any file to C++ header file.
usage: file_to_header.py [-h] -i INPUT -o OUTPUT -n NAME [-k KEY]
Converts any file to C++ header file.
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Input file name
-o OUTPUT, --output OUTPUT
Output file name
-n NAME, --name NAME Variable name
-k KEY, --key KEY XOR key
$ python3 file_to_header.py --input input.txt --output output.h --name DATA
input.txt:
Hello World
output.h:
/* Auto generated file. */
const unsigned char DATA[] =
{
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64
};