diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-03-03 23:52:08 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-03-03 23:52:08 +0100 |
commit | 1643b745af309f754959621fa2a631c899ba1975 (patch) | |
tree | 19d6252ad82a78e432b8c969b948a7e0cb36c33b /src/util/payto.c | |
parent | f951cdef8ced141326887c1a996e8546774514f6 (diff) | |
download | exchange-1643b745af309f754959621fa2a631c899ba1975.tar.xz |
use 32 byte hash for hpayto, use that for joins on queries to better align queries with partitions
Diffstat (limited to 'src/util/payto.c')
-rw-r--r-- | src/util/payto.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util/payto.c b/src/util/payto.c index bfc8eb1ba..c596f8d3f 100644 --- a/src/util/payto.c +++ b/src/util/payto.c @@ -228,9 +228,16 @@ void TALER_payto_hash (const char *payto, struct TALER_PaytoHashP *h_payto) { + struct GNUNET_HashCode sha512; + GNUNET_CRYPTO_hash (payto, strlen (payto) + 1, - &h_payto->hash); + &sha512); + GNUNET_static_assert (sizeof (sha512) > sizeof (*h_payto)); + /* truncate */ + memcpy (h_payto, + &sha512, + sizeof (*h_payto)); } |