Skip to content

Commit

Permalink
feat: remove rand.Seed
Browse files Browse the repository at this point in the history
  • Loading branch information
zema1 committed Sep 4, 2023
1 parent bec7070 commit 53aaa47
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions netrans/frame.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package netrans

import (
"crypto/rand"
"encoding/binary"
"fmt"
"io"
"math/rand"
"time"
)

func init() {
rand.Seed(time.Now().UnixNano())
}

type DataFrame struct {
Length uint32
Obs byte
Expand All @@ -20,7 +15,7 @@ type DataFrame struct {

func NewDataFrame(data []byte) *DataFrame {
b := make([]byte, 1)
rand.Read(b)
_, _ = rand.Read(b)
return &DataFrame{
Length: uint32(len(data)),
Obs: b[0],
Expand Down

0 comments on commit 53aaa47

Please sign in to comment.