Skip to content

abs0luty/apple_map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍎 Apple map

Apple map is a C library written in half an hour, that implements a hashmap using FNV-1a hashing algorithm.

Create a hashmap in 1 line of code:

apple_map *map = apple_map_new();

Add entries into it in 1 line of code:

apple_map_insert(
  map,
  "hello", // key
  sizeof("hello") - 1,
  1 // value
);

Remove entries from it in 1 line of code:

apple_map_remove(map, "hello", sizeof("hello") - 1);

Resolve values by keys in 1 function call:

uintptr_t value;

if (apple_map_get(map, "hello", sizeof("hello") - 1, &value)) {
  printf("map[\"hello\"] = %d\n", value);
}

And finally free the map:

apple_map_free(map);

You can take a look at examples here.

About

🍎 Clean and concise hashmap implementation written in the C programming language using FNV-1a hash function.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages