// SPDX-License-Identifier: MIT // Copyright (c) 2023 John Watts and the LuminaSensum contributors #include "symbol.h" #include <stdint.h> // FNV-1a Algorithm from http://www.isthe.com/chongo/tech/comp/fnv/ // Thanks for releasing it to the public domain :) uint32_t fnv32a_str(unsigned char *str) { uint32_t hash = (uint32_t)0x811c9dc5; while (*str) { hash ^= (uint32_t)*str++; hash *= (uint32_t)0x01000193; } return hash; } symbol find_symbol(char *name) { return fnv32a_str((unsigned char *)name); }