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
- Host: GitHub
- URL: https://github.com/newyaroslav/siphash-hpp
- Owner: NewYaroslav
- License: cc0-1.0
- Created: 2021-10-09T06:26:15.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-09T12:29:26.000Z (about 4 years ago)
- Last Synced: 2025-01-08T17:52:11.972Z (10 months ago)
- Topics: cryptographic-hash-functions, cryptography, hash, pseudorandom-functions, siphash
- Language: C++
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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;
```