-->
Page 1 of 1

How is a file converted to a byte array?

PostPosted: Tue Jan 24, 2017 9:59 pm
by damage31
How does someone take a file such as icon, jpg, or gzip file- and convert it into a byte array that can then be saved out to PROGMEM like is shown in example below?

Like what is shown here: https://github.com/me-no-dev/ESPAsyncWebServer#send-binary-content-from-progmem with a small sample shown below:

const uint8_t favicon_ico_gz[] PROGMEM = {
0x1F, 0x8B, 0x08, 0x08, 0x0B, 0x87...

How do they get the "0x1F, 0x8B, 0x08, 0x08, 0x0B, 0x87" part? What kind of software is out there that can do this?

Re: How is a file converted to a byte array?

PostPosted: Tue Jan 24, 2017 11:59 pm
by GregryCM
Search this forum for hexy.
https://github.com/tristan2468/Hexy

I have used it, and it did the trick.