Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread David Howells
Mimi Zohar wrote: > I'm suggesting making bin2hex() a wrapper for calling hex_byte_pack(). Done. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread David Howells
Joe Perches wrote: > I think Mimi meant using something like: > > 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; > } Ah, I see - yeah,

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread Mimi Zohar
On Fri, 2014-09-12 at 21:30 +0100, David Howells wrote: > Mimi Zohar wrote: > > > How about using hex_byte_pack()? > > It doesn't do a bufferful, only one byte. The following code snippet is pretty common: for (i = 0; i < count; i++) bufptr = hex_byte_pack(bufptr, s[i]); I'm suggesting

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread Joe Perches
On Fri, 2014-09-12 at 21:30 +0100, David Howells wrote: > Mimi Zohar wrote: > > How about using hex_byte_pack()? > It doesn't do a bufferful, only one byte. I think Mimi meant using something like: char *bin2hex(char *dst, const void *src, size_t count) { const unsigned char *_src =

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread David Howells
Mimi Zohar wrote: > How about using hex_byte_pack()? It doesn't do a bufferful, only one byte. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread Mimi Zohar
On Fri, 2014-09-12 at 20:05 +0100, David Howells wrote: > Provide a function to convert a buffer of binary data into an unterminated > ascii hex string representation of that data. > > Signed-off-by: David Howells > --- > > include/linux/kernel.h |1 + > lib/hexdump.c | 18

[PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread David Howells
Provide a function to convert a buffer of binary data into an unterminated ascii hex string representation of that data. Signed-off-by: David Howells --- include/linux/kernel.h |1 + lib/hexdump.c | 18 ++ 2 files changed, 19 insertions(+) diff --git

[PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread David Howells
Provide a function to convert a buffer of binary data into an unterminated ascii hex string representation of that data. Signed-off-by: David Howells dhowe...@redhat.com --- include/linux/kernel.h |1 + lib/hexdump.c | 18 ++ 2 files changed, 19 insertions(+)

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread Mimi Zohar
On Fri, 2014-09-12 at 20:05 +0100, David Howells wrote: Provide a function to convert a buffer of binary data into an unterminated ascii hex string representation of that data. Signed-off-by: David Howells dhowe...@redhat.com --- include/linux/kernel.h |1 + lib/hexdump.c

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread David Howells
Mimi Zohar zo...@linux.vnet.ibm.com wrote: How about using hex_byte_pack()? It doesn't do a bufferful, only one byte. David -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread Joe Perches
On Fri, 2014-09-12 at 21:30 +0100, David Howells wrote: Mimi Zohar zo...@linux.vnet.ibm.com wrote: How about using hex_byte_pack()? It doesn't do a bufferful, only one byte. I think Mimi meant using something like: char *bin2hex(char *dst, const void *src, size_t count) { const

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread David Howells
Joe Perches j...@perches.com wrote: I think Mimi meant using something like: 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; } Ah, I see - yeah,

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread Mimi Zohar
On Fri, 2014-09-12 at 21:30 +0100, David Howells wrote: Mimi Zohar zo...@linux.vnet.ibm.com wrote: How about using hex_byte_pack()? It doesn't do a bufferful, only one byte. The following code snippet is pretty common: for (i = 0; i count; i++) bufptr = hex_byte_pack(bufptr, s[i]);

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread David Howells
Mimi Zohar zo...@linux.vnet.ibm.com wrote: I'm suggesting making bin2hex() a wrapper for calling hex_byte_pack(). Done. David -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at