mask_safe.go 360 B

12345678910111213141516
  1. // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of
  2. // this source code is governed by a BSD-style license that can be found in the
  3. // LICENSE file.
  4. //go:build appengine
  5. // +build appengine
  6. package websocket
  7. func maskBytes(key [4]byte, pos int, b []byte) int {
  8. for i := range b {
  9. b[i] ^= key[pos&3]
  10. pos++
  11. }
  12. return pos & 3
  13. }