aboutsummaryrefslogtreecommitdiff
path: root/src/std/hash.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-03-07 22:19:57 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit27718f093689dbd3decd7021eaa97327f578c8f3 (patch)
treec41ab4bb5727b22be35c1237279cfdfec0a27561 /src/std/hash.c
parent81b6004928015ced29b0b949e35753977aa17606 (diff)
Add hash map
Diffstat (limited to 'src/std/hash.c')
-rw-r--r--src/std/hash.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/std/hash.c b/src/std/hash.c
new file mode 100644
index 0000000..603149a
--- /dev/null
+++ b/src/std/hash.c
@@ -0,0 +1,14 @@
+#include "../../include/std/hash.h"
+
+usize amal_hash_string(const u8 *data, usize size) {
+ usize result;
+ result = 0xdec05eba;
+
+ while(size) {
+ result ^= *data;
+ ++data;
+ --size;
+ }
+
+ return result;
+}