/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2020, Danny Robson */ #pragma once #include "../bitwise.hpp" #include /////////////////////////////////////////////////////////////////////////////// namespace cruft::hash::adapter { template class combine { public: using digest_t = typename HashT::digest_t; using seed_t = typename HashT::seed_t; template combine (ArgsT &&...args) : m_inner (std::forward (args)...) { ; } decltype(auto) operator() (cruft::view data) { return m_inner (data); } template decltype(auto) operator() ( cruft::view data, TailT &&...tail ) { return (*this) (data) ^ cruft::rotatel ((*this) (tail...), 6); } private: HashT m_inner; }; }