Feature/ws cli (#15)
* New command line tool for transfering files / still very beta. * add readme * use cli11 for argument parsing * json -> msgpack * stop using base64 and use binary which can be stored in message pack
This commit is contained in:
committed by
GitHub
parent
709a5ec89a
commit
2d696b6806
22
ws/ixcrypto/IXHash.cpp
Normal file
22
ws/ixcrypto/IXHash.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* IXHash.h
|
||||
* Author: Benjamin Sergeant
|
||||
* Copyright (c) 2018 Machine Zone. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "IXHash.h"
|
||||
|
||||
namespace ix
|
||||
{
|
||||
uint64_t djb2Hash(const std::vector<uint8_t>& data)
|
||||
{
|
||||
uint64_t hashAddress = 5381;
|
||||
|
||||
for (auto&& c : data)
|
||||
{
|
||||
hashAddress = ((hashAddress << 5) + hashAddress) + c;
|
||||
}
|
||||
|
||||
return hashAddress;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user