Created
January 28, 2015 22:18
-
-
Save themadinventor/3b0b097fb5aa50e23a0d to your computer and use it in GitHub Desktop.
Convert binary file (blob) to c-style array.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bin2c() { | |
| output=${2-/dev/stdout} | |
| echo -n "uint8_t data[] = {" > "$output" | |
| hexdump -v -e '"0x" 1/1 "%02X" ", "' $1 >> "$output" | |
| echo "};" >> "$output" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment