FreeCalypso > hg > freecalypso-tools
comparison uptools/libcoding/hexencode.c @ 361:ae2556e256a4
uptools/libcoding: implemented function for generating hex strings
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 04 Mar 2018 23:11:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
360:68c8cf672ecd | 361:ae2556e256a4 |
---|---|
1 /* | |
2 * This module contains the function for generating hex strings. | |
3 */ | |
4 | |
5 #include <sys/types.h> | |
6 #include <stdio.h> | |
7 | |
8 make_hex_string(inbuf, len, outbuf) | |
9 u_char *inbuf; | |
10 unsigned len; | |
11 char *outbuf; | |
12 { | |
13 char *dp = outbuf; | |
14 unsigned n; | |
15 | |
16 for (n = 0; n < len; n++) { | |
17 sprintf(dp, "%02X", inbuf[n]); | |
18 dp += 2; | |
19 } | |
20 *dp = '\0'; | |
21 } |