cln/common/hash_str.h
Rusty Russell 581bbb1fb8 common: hoist hash_str helper into its own header.
We have three uses already, about to add a fourth.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-08-04 18:51:43 -03:00

11 lines
270 B
C

#ifndef LIGHTNING_COMMON_HASH_STR_H
#define LIGHTNING_COMMON_HASH_STR_H
#include "config.h"
#include <common/pseudorand.h>
static inline size_t hash_str(const char *str)
{
return siphash24(siphash_seed(), str, strlen(str));
}
#endif /* LIGHTNING_COMMON_HASH_STR_H */