diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-02-05 08:38:23 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-02-05 08:38:23 +0100 |
commit | 7fbee6ce27176bfc7ae9b34a4de9452cf5f6fa43 (patch) | |
tree | 5cabb0ab457846912d99ef675160be0dce4fbe6f /src/mm-utils.c | |
parent | dc645b92b9a7db3076ae34986ac219d01677d124 (diff) |
Imported Upstream version 0.4+git.20110124t203624.00b6cceupstream/0.4+git.20110124t203624.00b6cce
Diffstat (limited to 'src/mm-utils.c')
-rw-r--r-- | src/mm-utils.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mm-utils.c b/src/mm-utils.c index 56182c0..c435d1d 100644 --- a/src/mm-utils.c +++ b/src/mm-utils.c @@ -76,3 +76,17 @@ utils_hexstr2bin (const char *hex, gsize *out_len) /* End from hostap */ +char * +utils_bin2hexstr (const guint8 *bin, gsize len) +{ + GString *ret; + gsize i; + + g_return_val_if_fail (bin != NULL, NULL); + + ret = g_string_sized_new (len * 2 + 1); + for (i = 0; i < len; i++) + g_string_append_printf (ret, "%.2X", bin[i]); + return g_string_free (ret, FALSE); +} + |