Blog 2015/9/26
<- previous | index | next ->
hexify.c: a snprintf-styled function for turning data into hex
I liked this implementation of a hexification algorithm,
so I wrapped it up into a function (styled after the snprintf
interface).
$ gcc hexify.c
$ ./a.out
test 1
buff: , bytes_written: 0
test 2
buff: , bytes_written: 0
test 3
buff: fe, bytes_written: 2
test 4
buff: fefd, bytes_written: 4
test 5
buff: fcfb, bytes_written: 4