MCPcopy
hub / github.com/coder/websocket / Test_mask

Function Test_mask

frame_test.go:93–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

91}
92
93func Test_mask(t *testing.T) {
94 t.Parallel()
95
96 key := []byte{0xa, 0xb, 0xc, 0xff}
97 key32 := binary.LittleEndian.Uint32(key)
98 p := []byte{0xa, 0xb, 0xc, 0xf2, 0xc}
99 gotKey32 := mask(p, key32)
100
101 expP := []byte{0, 0, 0, 0x0d, 0x6}
102 assert.Equal(t, "p", expP, p)
103
104 expKey32 := bits.RotateLeft32(key32, -8)
105 assert.Equal(t, "key32", expKey32, gotKey32)
106}

Callers

nothing calls this directly

Calls 2

EqualFunction · 0.92
maskFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…