#include unsigned char inbuf[]="Now is the time for all "; unsigned char outbuf[50]; void hexdump(unsigned char *p, int n) { for (int i=0; i 6) { *dst++ = buf & 0x3f; buf >>= 6; bits -= 6; } } hexdump(outbuf, dst-outbuf); }