libpulsar
A modular compiler for the pulsar programming language
Loading...
Searching...
No Matches
Macros | Functions
hash.c File Reference
#include <string.h>
#include "hash.h"

Go to the source code of this file.

Macros

#define FNV_OFFSET_BASIS   0xcbf29ce484222325
 
#define FNV_PRIME   0x100000001b3
 

Functions

hash_t ps_str_hash (STR str)
 Hashes the given string according to the FNV-1a algorithm.
 
bool ps_str_is_equal (STR a, STR b)
 Compares the given strings.
 

Macro Definition Documentation

◆ FNV_OFFSET_BASIS

#define FNV_OFFSET_BASIS   0xcbf29ce484222325

Definition at line 9 of file hash.c.

◆ FNV_PRIME

#define FNV_PRIME   0x100000001b3

Definition at line 10 of file hash.c.

Function Documentation

◆ ps_str_hash()

hash_t ps_str_hash ( STR  str)

Hashes the given string according to the FNV-1a algorithm.

Parameters
strThe string to hash.

Definition at line 12 of file hash.c.

◆ ps_str_is_equal()

bool ps_str_is_equal ( STR  a,
STR  b 
)

Compares the given strings.

Parameters
aThe first string.
bThe second string.
Returns
True if the strings are equal, false otherwise.

Definition at line 21 of file hash.c.