/*@=type@*/
/*@=sizeoftype@*/
/*@=boundsread@*/
+
+char * bin2hex(const char *data, size_t size)
+{
+ static char hex[] = "0123456789abcdef";
+ const char * s = data;
+ char * t, * val;
+ val = t = xmalloc(size * 2 + 1);
+ while (size-- > 0) {
+ unsigned int i;
+ i = *s++;
+ *t++ = hex[ (i >> 4) & 0xf ];
+ *t++ = hex[ (i ) & 0xf ];
+ }
+ *t = '\0';
+
+ return val;
+}
+
+
/*@modifies f, fileSystem @*/;
#define HEADER_DUMP_INLINE 1
+/* XXX not perhaps the right place but.. */
+/** \ingroup header
+ * Convert binary blob to printable hex string
+ * @param data binary data
+ * @param size size of data in bytes
+ */
+char * bin2hex(const char *data, size_t count);
+
#ifdef __cplusplus
}
#endif