anchor.diff:  %% A frame MUST NOT use the zero opcode unless fragmentation was initiated.
   parse_header(<< _:4, 0:4, _/bits >>, _, undefined) -> error;
   %% Non-control opcode when expecting control message or next fragment.
  -parse_header(<< _:4, 1:4, _/bits >>, _, {_, _}) -> error;
  -parse_header(<< _:4, 2:4, _/bits >>, _, {_, _}) -> error;
  -parse_header(<< _:4, 3:4, _/bits >>, _, {_, _}) -> error;
  -parse_header(<< _:4, 4:4, _/bits >>, _, {_, _}) -> error;
  -parse_header(<< _:4, 5:4, _/bits >>, _, {_, _}) -> error;
  -parse_header(<< _:4, 6:4, _/bits >>, _, {_, _}) -> error;
  -parse_header(<< _:4, 7:4, _/bits >>, _, {_, _}) -> error;
  +parse_header(<< _:4, 1:4, _/bits >>, _, {_, _, _}) -> error;
  +parse_header(<< _:4, 2:4, _/bits >>, _, {_, _, _}) -> error;
  +parse_header(<< _:4, 3:4, _/bits >>, _, {_, _, _}) -> error;
  +parse_header(<< _:4, 4:4, _/bits >>, _, {_, _, _}) -> error;
  +parse_header(<< _:4, 5:4, _/bits >>, _, {_, _, _}) -> error;
  +parse_header(<< _:4, 6:4, _/bits >>, _, {_, _, _}) -> error;
  +parse_header(<< _:4, 7:4, _/bits >>, _, {_, _, _}) -> error;
   %% Close control frame length MUST be 0 or >= 2.
   parse_header(<< _:4, 8:4, _:1, 1:7, _/bits >>, _, _) -> error;
   %% Close control frame with incomplete close code. Need more data.
  
positive.code: %% that defines meanings for non-zero values.
  parse_header(<< _:1, Rsv:3, _/bits >>, Extensions, _) when Extensions =:= #{}, Rsv =/= 0 -> error;
  %% Last 2 RSV bits MUST be 0 if deflate-frame extension is used.
  parse_header(<< _:2, 1:1, _/bits >>, #{deflate_frame := _}, _) -> error;
  parse_header(<< _:3, 1:1, _/bits >>, #{deflate_frame := _}, _) -> error;
  %% Invalid opcode. Note that these opcodes may be used by extensions.
  parse_header(<< _:4, 3:4, _/bits >>, _, _) -> error;
  parse_header(<< _:4, 4:4, _/bits >>, _, _) -> error;
  
negative.code: validate_utf8(_) ->
  	false.
  
  %% @doc Return a frame tuple from parsed state and data.
  
  -spec make_frame(frame_type(), binary(), close_code(), frag_state()) -> frame().
  %% Fragmented frame.
  make_frame(fragment, Payload, _, {Fin, Type, _}) -> {fragment, Fin, Type, Payload};
  make_frame(text, Payload, _, _) -> {text, Payload};
  make_frame(binary, Payload, _, _) -> {binary, Payload};
  make_frame(close, <<>>, undefined, _) -> close;
  make_frame(close, Payload, CloseCode, _) -> {close, CloseCode, Payload};
  make_frame(ping, <<>>, _, _) -> ping;
  make_frame(ping, Payload, _, _) -> {ping, Payload};
  make_frame(pong, <<>>, _, _) -> pong;
  make_frame(pong, Payload, _, _) -> {pong, Payload}.
  
  %% @doc Construct an unmasked Websocket frame.
  %% @todo Add fragments support.
  
  -spec frame(frame(), extensions()) -> iodata().
  %% Control frames. Control packets must not be > 125 in length.
  