// Copyright 2017 Peter Dimov. // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include #include #include template void test( char const * s, R r ) { H h; h.update( s, std::strlen( s ) ); BOOST_TEST_EQ( h.result(), r ); } int main() { // Test vectors from https://tools.ietf.org/html/draft-eastlake-fnv-14 test( "", 0x811c9dc5ul ); test( "a", 0xe40c292cul ); test( "foobar", 0xbf9cf968ul ); test( "", 0xcbf29ce484222325ull ); test( "a", 0xaf63dc4c8601ec8cull ); test( "foobar", 0x85944171f73967e8ull ); return boost::report_errors(); }