|
@@ -58,6 +58,22 @@ int hex2bin(u8 *dst, const char *src, size_t count)
|
|
|
}
|
|
|
EXPORT_SYMBOL(hex2bin);
|
|
|
|
|
|
+/**
|
|
|
+ * bin2hex - convert binary data to an ascii hexadecimal string
|
|
|
+ * @dst: ascii hexadecimal result
|
|
|
+ * @src: binary data
|
|
|
+ * @count: binary data length
|
|
|
+ */
|
|
|
+char *bin2hex(char *dst, const void *src, size_t count)
|
|
|
+{
|
|
|
+ const unsigned char *_src = src;
|
|
|
+
|
|
|
+ while (count--)
|
|
|
+ dst = hex_byte_pack(dst, *_src++);
|
|
|
+ return dst;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(bin2hex);
|
|
|
+
|
|
|
/**
|
|
|
* hex_dump_to_buffer - convert a blob of data to "hex ASCII" in memory
|
|
|
* @buf: data blob to dump
|