mkp224o/hex.h

13 lines
244 B
C
Raw Normal View History

2017-09-24 21:13:16 +02:00
#include <stdio.h>
static const char hext[] = "0123456789ABCDEF";
static void printhex(const unsigned char *z,size_t l)
2017-09-24 21:13:16 +02:00
{
printf("[");
for (size_t i = 0;i < l;++i) {
printf("%c%c",hext[*z >> 4],hext[*z & 0xF]);
2017-09-24 21:13:16 +02:00
++z;
}
printf("]\n");
}