diff options
Diffstat (limited to 'src/util/util.c')
-rw-r--r-- | src/util/util.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/util/util.c b/src/util/util.c index de085d088..b09f4dbdd 100644 --- a/src/util/util.c +++ b/src/util/util.c | |||
@@ -28,36 +28,6 @@ | |||
28 | #include <gnunet/gnunet_util_lib.h> | 28 | #include <gnunet/gnunet_util_lib.h> |
29 | #include <gcrypt.h> | 29 | #include <gcrypt.h> |
30 | 30 | ||
31 | /** | ||
32 | * Return the base32crockford encoding of the given buffer. | ||
33 | * | ||
34 | * The returned string will be freshly allocated, and must be free'd | ||
35 | * with GNUNET_free(). | ||
36 | * | ||
37 | * @param buffer with data | ||
38 | * @param size size of the buffer | ||
39 | * @return freshly allocated, null-terminated string | ||
40 | */ | ||
41 | char * | ||
42 | TALER_data_to_string_alloc (const void *buf, size_t size) | ||
43 | { | ||
44 | char *str_buf; | ||
45 | size_t len = size * 8; | ||
46 | char *end; | ||
47 | |||
48 | if (len % 5 > 0) | ||
49 | len += 5 - len % 5; | ||
50 | len /= 5; | ||
51 | str_buf = GNUNET_malloc (len + 1); | ||
52 | end = GNUNET_STRINGS_data_to_string (buf, size, str_buf, len); | ||
53 | if (NULL == end) | ||
54 | { | ||
55 | GNUNET_free (str_buf); | ||
56 | return NULL; | ||
57 | } | ||
58 | *end = '\0'; | ||
59 | return str_buf; | ||
60 | } | ||
61 | 31 | ||
62 | 32 | ||
63 | /** | 33 | /** |