13 lines
287 B
Python
13 lines
287 B
Python
#!/usr/bin/env python3
|
|
import click
|
|
import sys
|
|
|
|
@click.command()
|
|
def convert_to_c_header():
|
|
data = sys.stdin.buffer.read()
|
|
|
|
for i in range(0, len(data), 16):
|
|
print(', '.join(f'0x{c:02x}' for c in data[i:i+16]) + ',')
|
|
|
|
if __name__ == '__main__':
|
|
convert_to_c_header()
|