aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/namestore_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/namestore_common.c')
-rw-r--r--src/namestore/namestore_common.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/namestore/namestore_common.c b/src/namestore/namestore_common.c
index 45fccbb18..403f75ea8 100644
--- a/src/namestore/namestore_common.c
+++ b/src/namestore/namestore_common.c
@@ -66,6 +66,25 @@ struct NetworkRecord
66 66
67}; 67};
68 68
69
70/**
71 * Convert a short hash to a string (for printing debug messages).
72 * This is one of the very few calls in the entire API that is
73 * NOT reentrant!
74 *
75 * @param hc the short hash code
76 * @return string form; will be overwritten by next call to GNUNET_h2s.
77 */
78const char *
79GNUNET_short_h2s (const struct GNUNET_CRYPTO_ShortHashCode * hc)
80{
81 static struct GNUNET_CRYPTO_ShortHashAsciiEncoded ret;
82
83 GNUNET_CRYPTO_short_hash_to_enc (hc, &ret);
84 return (const char *) &ret;
85}
86
87
69/** 88/**
70 * Calculate how many bytes we will need to serialize the given 89 * Calculate how many bytes we will need to serialize the given
71 * records. 90 * records.