MaskFrameInPlaceWith masks frame with given mask and returns frame with masked payload and Mask header's field set. Note that it applies xor cipher to f.Payload without copying, that is, it modifies f.Payload inplace.
(f Frame, m [4]byte)
| 369 | // Note that it applies xor cipher to f.Payload without copying, that is, it |
| 370 | // modifies f.Payload inplace. |
| 371 | func MaskFrameInPlaceWith(f Frame, m [4]byte) Frame { |
| 372 | f.Header.Masked = true |
| 373 | f.Header.Mask = m |
| 374 | Cipher(f.Payload, m, 0) |
| 375 | return f |
| 376 | } |
| 377 | |
| 378 | // NewMask creates new random mask. |
| 379 | func NewMask() (ret [4]byte) { |
no test coverage detected
searching dependent graphs…