forked from quic-go/quic-go
remove entropy from packet packer
This commit is contained in:
@@ -2,7 +2,6 @@ package utils
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"io"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/protocol"
|
||||
@@ -163,13 +162,6 @@ func WriteUint16(b *bytes.Buffer, i uint16) {
|
||||
b.WriteByte(uint8(i >> 8))
|
||||
}
|
||||
|
||||
// RandomBit returns a cryptographically secure random bit (encoded as true / false)
|
||||
func RandomBit() (bool, error) {
|
||||
b := make([]byte, 1)
|
||||
_, err := rand.Read(b)
|
||||
return b[0]%2 == 0, err
|
||||
}
|
||||
|
||||
// Uint32Slice attaches the methods of sort.Interface to []uint32, sorting in increasing order.
|
||||
type Uint32Slice []uint32
|
||||
|
||||
|
||||
Reference in New Issue
Block a user