From a57e77e46a453c5e556061970ce63f579c8e27f3 Mon Sep 17 00:00:00 2001
From: Oleg Hahm <oleg@hobbykeller.org>
Date: Thu, 28 Jan 2016 14:20:54 +0100
Subject: [PATCH] sys: remove hash_string module

hash_string implements djb2 which is already part of `sys/hashes/`
---
 sys/hash_string/Makefile                      |  1 -
 sys/hash_string/hash_string.c                 | 39 ----------------
 sys/include/hash_string.h                     | 23 ----------
 tests/unittests/tests-hash_string/Makefile    |  1 -
 .../tests-hash_string/Makefile.include        |  1 -
 .../tests-hash_string/tests-hash_string.c     | 39 ----------------
 .../tests-hash_string/tests-hash_string.h     | 44 -------------------
 7 files changed, 148 deletions(-)
 delete mode 100644 sys/hash_string/Makefile
 delete mode 100644 sys/hash_string/hash_string.c
 delete mode 100644 sys/include/hash_string.h
 delete mode 100644 tests/unittests/tests-hash_string/Makefile
 delete mode 100644 tests/unittests/tests-hash_string/Makefile.include
 delete mode 100644 tests/unittests/tests-hash_string/tests-hash_string.c
 delete mode 100644 tests/unittests/tests-hash_string/tests-hash_string.h

diff --git a/sys/hash_string/Makefile b/sys/hash_string/Makefile
deleted file mode 100644
index 48422e909a..0000000000
--- a/sys/hash_string/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-include $(RIOTBASE)/Makefile.base
diff --git a/sys/hash_string/hash_string.c b/sys/hash_string/hash_string.c
deleted file mode 100644
index a23d194e55..0000000000
--- a/sys/hash_string/hash_string.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2013 Kaspar Schleiser <kaspar@schleiser.de>
- *
- * This file is subject to the terms and conditions of the GNU Lesser
- * General Public License v2.1. See the file LICENSE in the top level
- * directory for more details.
- */
-
-/**
- * @defgroup sys_hash_string
- * @ingroup sys
- *
- * @brief Hash string implementation
- *
- * @{
- * @file
- * @author Kaspar Schleiser <kaspar@schleiser.de>
- * @}
- */
-
-#include <string.h>
-#include "hash_string.h"
-
-unsigned long hash_string(unsigned char *str)
-{
-    unsigned long hash = 5381;
-    int c;
-
-    while ((c = *str++)) {
-        hash = ((hash << 5) + hash) + c;    /* hash * 33 + c */
-    }
-
-    return hash;
-}
-
-int cmp_string(char *a, char *b)
-{
-    return (strcmp(a, b) == 0);
-}
diff --git a/sys/include/hash_string.h b/sys/include/hash_string.h
deleted file mode 100644
index d65dedd8ca..0000000000
--- a/sys/include/hash_string.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2010 Kaspar Schleiser
- *
- * This file is subject to the terms and conditions of the GNU Lesser
- * General Public License v2.1. See the file LICENSE in the top level
- * directory for more details.
- */
-
-#ifndef __HASH_STRING_H
-#define __HASH_STRING_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-unsigned long hash_string(unsigned char *str);
-int cmp_string(char *a, char *b);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __HASH_STRING_H */
diff --git a/tests/unittests/tests-hash_string/Makefile b/tests/unittests/tests-hash_string/Makefile
deleted file mode 100644
index 48422e909a..0000000000
--- a/tests/unittests/tests-hash_string/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-include $(RIOTBASE)/Makefile.base
diff --git a/tests/unittests/tests-hash_string/Makefile.include b/tests/unittests/tests-hash_string/Makefile.include
deleted file mode 100644
index f00ccb4f5b..0000000000
--- a/tests/unittests/tests-hash_string/Makefile.include
+++ /dev/null
@@ -1 +0,0 @@
-USEMODULE += hash_string
diff --git a/tests/unittests/tests-hash_string/tests-hash_string.c b/tests/unittests/tests-hash_string/tests-hash_string.c
deleted file mode 100644
index 13b292dfbc..0000000000
--- a/tests/unittests/tests-hash_string/tests-hash_string.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2015 Kushal Singh <kushal.spiderman.singh@gmail.com>
- *
- * This file is subject to the terms and conditions of the GNU Lesser
- * General Public License v2.1. See the file LICENSE in the top level
- * directory for more details.
- */
-
-#include "tests-hash_string.h"
-#include "hash_string.h"
-
-static void test_hash_value(void)
-{
-    TEST_ASSERT_EQUAL_INT(177621, hash_string((unsigned char *)"0"));
-    TEST_ASSERT_EQUAL_INT(685012521, hash_string((unsigned char *)"0123456789ab"
-                                                "cde-0123456789abcde-0123456789"
-                                                "abcde-0123456789abcde-"));
-    TEST_ASSERT_EQUAL_INT(900068641, hash_string((unsigned char *)"Frank jagt "
-                                                "im komplett verwahrlosten Taxi"
-                                                " quer durch Bayern"));
-    TEST_ASSERT_EQUAL_INT(1857959484, hash_string((unsigned char *)"12A5B6cd_"));
-    TEST_ASSERT_EQUAL_INT(5381, hash_string((unsigned char *)""));
-}
-
-Test *tests_hash_string_tests(void)
-{
-    EMB_UNIT_TESTFIXTURES(fixtures) {
-        new_TestFixture(test_hash_value),
-    };
-
-    EMB_UNIT_TESTCALLER(hash_string_tests, NULL, NULL, fixtures);
-
-    return (Test *)&hash_string_tests;
-}
-
-void tests_hash_string(void)
-{
-    TESTS_RUN(tests_hash_string_tests());
-}
diff --git a/tests/unittests/tests-hash_string/tests-hash_string.h b/tests/unittests/tests-hash_string/tests-hash_string.h
deleted file mode 100644
index 75cb503c47..0000000000
--- a/tests/unittests/tests-hash_string/tests-hash_string.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2015 Kushal Singh <kushal.spiderman.singh@gmail.com>
- *
- * This file is subject to the terms and conditions of the GNU Lesser
- * General Public License v2.1. See the file LICENSE in the top level
- * directory for more details.
- */
-
-/**
- * @addtogroup  unittests
- * @{
- *
- * @file
- * @brief       Unittests for the ``hash_string`` module
- *
- * @author      Kushal Singh <kushal.spiderman.singh@gmail.com>
- */
-#ifndef TESTS_HASH_STRING_H_
-#define TESTS_HASH_STRING_H_
-
-#include "embUnit.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief   The entry point of this test suite.
- */
-void tests_hash_string(void);
-
-/**
- * @brief   Generates tests for hash_string
- *
- * @return  embUnit tests if successful, NULL if not.
- */
-Test *tests_hash_string_tests(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* TESTS_HASH_STRING_H_ */
-/** @} */
-- 
GitLab