Этот коммит содержится в:
Christopher Speller
2017-07-20 15:22:49 -07:00
коммит произвёл GitHub
родитель e2f4492ead
Коммит 58839cefb5
624 изменённых файлов: 103449 добавлений и 14954 удалений

12
vendor/github.com/gorilla/websocket/mask.go сгенерированный поставляемый
Просмотреть файл

@@ -2,20 +2,14 @@
// this source code is governed by a BSD-style license that can be found in the
// LICENSE file.
// +build !appengine
package websocket
import (
"math/rand"
"unsafe"
)
import "unsafe"
const wordSize = int(unsafe.Sizeof(uintptr(0)))
func newMaskKey() [4]byte {
n := rand.Uint32()
return [4]byte{byte(n), byte(n >> 8), byte(n >> 16), byte(n >> 24)}
}
func maskBytes(key [4]byte, pos int, b []byte) int {
// Mask one byte at a time for small buffers.