From d2fb255905f0c93f50db2112594307bb1265742c Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 19 Mar 2012 18:51:32 +0000 Subject: -new short hashes, new short hash cmp --- src/include/gnunet_crypto_lib.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/include/gnunet_crypto_lib.h') diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 86b862563..777ddd97e 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h @@ -512,6 +512,18 @@ GNUNET_CRYPTO_short_hash_from_string2 (const char *enc, size_t enclen, GNUNET_CRYPTO_short_hash_from_string2 (enc, strlen(enc), result) +/** + * Compare function for ShortHashCodes, producing a total ordering + * of all hashcodes. + * + * @param h1 some hash code + * @param h2 some hash code + * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2. + */ +int +GNUNET_CRYPTO_short_hash_cmp (const struct GNUNET_CRYPTO_ShortHashCode * h1, + const struct GNUNET_CRYPTO_ShortHashCode * h2); + /** * Compute the distance between 2 hashcodes. * The computation must be fast, not involve -- cgit v1.2.3