An open API service indexing awesome lists of open source software.

https://github.com/newyaroslav/siphash-hpp

SipHash Headers Only C ++ Library
https://github.com/newyaroslav/siphash-hpp

cryptographic-hash-functions cryptography hash pseudorandom-functions siphash

Last synced: 8 months ago
JSON representation

SipHash Headers Only C ++ Library

Awesome Lists containing this project

README

          

# siphash-hpp

[SipHash](https://en.wikipedia.org/wiki/SipHash) header only C ++ library

Exapmle:

```cpp
#include "siphash.hpp"

\\...

std::array key = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
std::string data("hello");

std::cout << "SipHash-2-4 for 'hello': " << siphash_hpp::siphash_2_4(data, key) << std::endl;
std::cout << "SipHash-4-8 for 'hello': " << siphash_hpp::siphash_4_8(data, key) << std::endl;
std::cout << "SipHash-4-8 for 'hello': " << siphash_hpp::siphash(data, key, 4, 8) << std::endl;

siphash_hpp::SipHash siphash;
siphash.init(key, 2, 4);
siphash.update(data);
std::cout << "SipHash-2-4 for 'hello': " << siphash.digest() << std::endl;
```