diff options
| author | Dylan <boss@tehbox.org> | 2026-04-02 11:58:24 +1300 |
|---|---|---|
| committer | Dylan <boss@tehbox.org> | 2026-04-02 11:58:24 +1300 |
| commit | e9a32a966d49ab798a4c6f24471669fc03adb395 (patch) | |
| tree | 6373120682604c489816df391c45f17841a838b6 /src/HashTable.h | |
| parent | 93a78ac64327b53f53952b625c7ce8a11bcc8651 (diff) | |
| download | tehimage-e9a32a966d49ab798a4c6f24471669fc03adb395.tar.gz tehimage-e9a32a966d49ab798a4c6f24471669fc03adb395.zip | |
feat: Added basic zlib compression
Currently not incredibly well implemented, but it can handle fixed
codes
Diffstat (limited to 'src/HashTable.h')
| -rw-r--r-- | src/HashTable.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/HashTable.h b/src/HashTable.h new file mode 100644 index 0000000..1ede7be --- /dev/null +++ b/src/HashTable.h @@ -0,0 +1,26 @@ +#pragma once + +#include <cstddef> +#include <cstring> +#include <list> +#include <utility> +#include <vector> + +namespace TehImage +{ + class HashTable + { + private: + const size_t TABLE_SIZE; + std::vector<std::list<std::pair<unsigned int, unsigned int>>> table; + + public: + HashTable(size_t size); + + unsigned int hashFunction(char key[3]); + void insert(char key[3], unsigned int value); + void remove(char key[3]); + unsigned int get(char key[3]); + bool contains(char key[3]); + }; +} |
