From: Yu Watanabe Date: Mon, 20 Jul 2020 19:42:11 +0000 (+0900) Subject: util: introduce siphash24_compress_string() X-Git-Tag: v246-rc2~10^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1c568d65ac285d2771f20429bbab4944c6dfd69b;p=thirdparty%2Fsystemd.git util: introduce siphash24_compress_string() --- diff --git a/src/basic/siphash24.h b/src/basic/siphash24.h index d29058e51dd..7f799ede3d1 100644 --- a/src/basic/siphash24.h +++ b/src/basic/siphash24.h @@ -25,6 +25,13 @@ static inline void siphash24_compress_boolean(bool in, struct siphash *state) { siphash24_compress(&i, sizeof i, state); } +static inline void siphash24_compress_string(const char *in, struct siphash *state) { + if (!in) + return; + + siphash24_compress(in, strlen(in), state); +} + uint64_t siphash24_finalize(struct siphash *state); uint64_t siphash24(const void *in, size_t inlen, const uint8_t k[static 16]);