restinio::websocket::basic::impl::unmasker_t Struct Reference

`#include <ws_protocol_validator.hpp>`

## Public Types

using | mask_array_t = std::array< uint8_t, websocket_masking_key_size >

## Public Member Functions

| unmasker_t ()=default
| unmasker_t (uint32_t masking_key)
uint8_t | unmask_byte (uint8_t masked_byte)
| Do unmask operation. More...
void | reset (uint32_t masking_key)
| Reset to initial state. More...

## Public Attributes

mask_array_t | m_mask
| Bytes array with masking key. More...
size_t | m_processed_bytes_count { 0 }
| Processed bytes counter. More...

## Detailed Description

This class is need to unmask byte sequences.

Mask is 32 bit key.

Definition at line 119 of file ws_protocol_validator.hpp.

## Member Typedef Documentation

## mask_array_t

using restinio::websocket::basic::impl::unmasker_t::mask_array_t = std::array< uint8_t, websocket_masking_key_size>

Definition at line 164 of file ws_protocol_validator.hpp.

## Constructor & Destructor Documentation

## unmasker_t() [1/2]

restinio::websocket::basic::impl::unmasker_t::unmasker_t | ( |  | ) |

default

## unmasker_t() [2/2]

restinio::websocket::basic::impl::unmasker_t::unmasker_t | ( | uint32_t | masking_key | ) |

inline

Definition at line 123 of file ws_protocol_validator.hpp.

## Member Function Documentation

## reset()

void restinio::websocket::basic::impl::unmasker_t::reset | ( | uint32_t | masking_key | ) |

inline

Reset to initial state.

Definition at line 148 of file ws_protocol_validator.hpp.

## unmask_byte()

uint8_t restinio::websocket::basic::impl::unmasker_t::unmask_byte | ( | uint8_t | masked_byte | ) |

inline

Do unmask operation.

Returns
  unmasked value.

Definition at line 141 of file ws_protocol_validator.hpp.

## Member Data Documentation

## m_mask

mask_array_t restinio::websocket::basic::impl::unmasker_t::m_mask

Bytes array with masking key.

Definition at line 167 of file ws_protocol_validator.hpp.

## m_processed_bytes_count

size_t restinio::websocket::basic::impl::unmasker_t::m_processed_bytes_count { 0 }

Processed bytes counter.

It needs for taking remainder after division on 4. Result of this operation is index of value in mask array for next unmask operation.

Definition at line 174 of file ws_protocol_validator.hpp.

The documentation for this struct was generated from the following file:

- restinio/websocket/impl/ws_protocol_validator.hpp