MCPcopy Index your code
hub / github.com/gobwas/ws / MaskFrameInPlaceWith

Function MaskFrameInPlaceWith

frame.go:371–376  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

369// Note that it applies xor cipher to f.Payload without copying, that is, it
370// modifies f.Payload inplace.
371func 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.
379func NewMask() (ret [4]byte) {

Callers 2

MaskFrameWithFunction · 0.85
MaskFrameInPlaceFunction · 0.85

Calls 1

CipherFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…