mask_safe.go raw

   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  
   5  //go:build appengine
   6  // +build appengine
   7  
   8  package websocket
   9  
  10  func maskBytes(key [4]byte, pos int, b []byte) int {
  11  	for i := range b {
  12  		b[i] ^= key[pos&3]
  13  		pos++
  14  	}
  15  	return pos & 3
  16  }
  17