(ws) add gzip and gunzip ws sub commands

This commit is contained in:
Benjamin Sergeant
2020-09-28 10:19:27 -07:00
parent 6077f86af8
commit 6f188a5131
11 changed files with 275 additions and 123 deletions

View File

@ -19,4 +19,16 @@ namespace ix
return hashAddress;
}
uint64_t djb2HashStr(const std::string& data)
{
uint64_t hashAddress = 5381;
for (size_t i = 0; i < data.size(); ++i)
{
hashAddress = ((hashAddress << 5) + hashAddress) + data[i];
}
return hashAddress;
}
} // namespace ix

View File

@ -8,8 +8,10 @@
#include <cstdint>
#include <vector>
#include <string>
namespace ix
{
uint64_t djb2Hash(const std::vector<uint8_t>& data);
uint64_t djb2HashStr(const std::string& data);
}