2.2.1 • Published 6 years ago
hashset-cpp v2.2.1
Hash Set
Implements a simple HashSet for strings in environments where you don't have the std lib available.
You should probably not be using this. Instead consider using hash_set which is a more generic implementation with templates.
This is only useful for very specific use cases having specific memory layout requirements.
Setup
npm install --save hashset-cppSample
#include <iostream>
#include "hash_set.h"
#include "test/example_data.h"
using std::cout;
using std::endl;
int main(int argc, char **argv) {
// Bucket size is 256 and don't allow multiple items per item hash.
HashSet<ExampleData> set(256, false);
set.Add(ExampleData("test"));
// Prints true
cout << "test exists: " << (set.Exists(ExampleData("test"))
? "true" : "false") << endl;
// Prints false
cout << "test2 exists: " << (set.Exists(ExampleData("test2"))
? "true" : "false") << endl;
uint32_t len;
char * buffer = set.Serialize(&len);
HashSet<ExampleData> set2(0, false);
set2.Deserialize(buffer, len);
// Prints true
cout << "test exists: " << (set2.Exists(ExampleData("test"))
? "true" : "false") << endl;
// Prints false
cout << "test2 exists: " << (set2.Exists(ExampleData("test2"))
? "true" : "false") << endl;
delete[] buffer;
return 0;
}Build everything in release
makeRunning sample
make sampleRunning tests
make testClearing build files
make cleanLinting
npm run lint2.2.1
6 years ago
2.2.0
6 years ago
2.1.1
6 years ago
2.1.0
7 years ago
2.0.2
7 years ago
2.0.1
8 years ago
1.0.18
8 years ago
2.0.0
8 years ago
1.0.17
9 years ago
1.0.16
9 years ago
1.0.15
10 years ago
1.0.14
10 years ago
1.0.13
10 years ago
1.0.12
10 years ago
1.0.11
10 years ago
1.0.10
10 years ago
1.0.9
10 years ago
1.0.8
10 years ago
1.0.7
10 years ago
1.0.6
10 years ago
1.0.5
10 years ago
1.0.4
10 years ago
1.0.2
10 years ago
1.0.0
10 years ago
0.2.1
10 years ago
0.2.0
10 years ago
0.1.2
10 years ago
0.1.1
10 years ago
0.1.0
10 years ago
0.0.7
10 years ago
0.0.6
10 years ago
0.0.5
10 years ago
0.0.4
10 years ago
0.0.3
10 years ago
0.0.2
10 years ago
0.0.1
10 years ago