2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 #ifndef BOOST_BEAST_WEBSOCKET_DETAIL_MASK_HPP
11 #define BOOST_BEAST_WEBSOCKET_DETAIL_MASK_HPP
13 #include <boost/beast/core/detail/config.hpp>
14 #include <boost/beast/core/buffers_range.hpp>
15 #include <boost/asio/buffer.hpp>
20 #include <type_traits>
27 using prepared_key = std::array<unsigned char, 4>;
31 prepare_key(prepared_key& prepared, std::uint32_t key);
33 // Apply mask in place
37 mask_inplace(net::mutable_buffer const& b, prepared_key& key);
39 // Apply mask in place
41 template<class MutableBufferSequence>
44 MutableBufferSequence const& buffers,
47 for(net::mutable_buffer b :
48 beast::buffers_range_ref(buffers))
49 detail::mask_inplace(b, key);
58 #if BOOST_BEAST_HEADER_ONLY
59 #include <boost/beast/websocket/detail/mask.ipp>