/* * simple hacked-up function to show (in hexadecimal) the bit representation * of a string of bytes. * bytes are printed in memory order, which for little-endian architectures * is least-significant first. */ #include void show_bytes(FILE * out, const void *bytes, const size_t sz) { unsigned char *uchar = (unsigned char *) bytes; for (size_t i = 0; i < sz; ++i) { fprintf(out, "%02x ", uchar[i]); } }