From c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:08:27 +0200 Subject: add: graphs et rushs --- graphs/piscine/hash_map/hash.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 graphs/piscine/hash_map/hash.c (limited to 'graphs/piscine/hash_map/hash.c') diff --git a/graphs/piscine/hash_map/hash.c b/graphs/piscine/hash_map/hash.c new file mode 100644 index 0000000..434616f --- /dev/null +++ b/graphs/piscine/hash_map/hash.c @@ -0,0 +1,13 @@ +#include + +size_t hash(const char *key) +{ + size_t i = 0; + size_t hash = 0; + + for (i = 0; key[i] != '\0'; ++i) + hash += key[i]; + hash += i; + + return hash; +} -- cgit v1.2.3