Unordered: Initial stab at siphash example.

[SVN r81973]
This commit is contained in:
Daniel James
2012-12-15 16:42:44 +00:00
parent 64994d76dd
commit bf1f24ab04
6 changed files with 413 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
// Copyright 2012 Daniel James.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// This is also released into the public domain.
#include "siphash.hpp"
#include <boost/random/random_device.hpp>
#include <boost/random/variate_generator.hpp>
#include <boost/random/uniform_int.hpp>
namespace hash
{
sipkey generate_sipkey()
{
boost::random_device rng;
boost::variate_generator<boost::random_device&,
boost::uniform_int<boost::uint64_t> > gen(rng,
boost::uniform_int<boost::uint64_t>());
sipkey k;
k.k0 = gen();
k.k1 = gen();
return k;
}
}