NewYaroslav / siphash-hpp

SipHash Headers Only C ++ Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

siphash-hpp

SipHash header only C ++ library

Exapmle:

#include "siphash.hpp"

\\...

std::array<char, 16> 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;

About

SipHash Headers Only C ++ Library

License:Creative Commons Zero v1.0 Universal


Languages

Language:C++ 100.0%