aboutsummaryrefslogtreecommitdiff
path: root/src/std/hash.c
blob: 82f711988fcb1c96c0fedec21d9b41dc52984205 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "../../include/std/hash.h"

usize amal_hash_string(const u8 *data, usize size) {
    usize result;
    result = 0xdec05eba;

    while(size) {
        result = ((result << 5) + result) + *data;
        ++data;
        --size;
    }

    return result;
}