@@ -10,7 +10,9 @@ import (
1010 "time"
1111
1212 "github.com/AspieSoft/go-regex-re2/v2"
13- "github.com/AspieSoft/goutil/v5"
13+ "github.com/AspieSoft/goutil/v7"
14+ "github.com/AspieSoft/goutil/crypt"
15+ goutil_GZIP "github.com/AspieSoft/goutil/compress/gzip"
1416 "github.com/alphadose/haxmap"
1517 "golang.org/x/net/websocket"
1618)
@@ -127,9 +129,9 @@ func (s *Server) handleWS(ws *websocket.Conn){
127129 }
128130
129131 clientID := s .clientUUID ()
130- token := string (goutil . Crypt .RandBytes (32 ))
131- serverKey := string (goutil . Crypt .RandBytes (32 ))
132- encKey := string (goutil . Crypt .RandBytes (64 ))
132+ token := string (crypt .RandBytes (32 ))
133+ serverKey := string (crypt .RandBytes (32 ))
134+ encKey := string (crypt .RandBytes (64 ))
133135
134136 client := Client {
135137 ws : ws ,
@@ -559,15 +561,15 @@ func MsgType[T goutil.SupportedType] (msg interface{}) interface{} {
559561}
560562
561563func (s * Server ) clientUUID () string {
562- uuid := goutil . Crypt .RandBytes (s .uuidSize )
564+ uuid := crypt .RandBytes (s .uuidSize )
563565
564566 var hasID bool
565567 _ , hasID = s .clients .Get (string (uuid ))
566568
567569 loops := 1000
568570 for hasID && loops > 0 {
569571 loops --
570- uuid = goutil . Crypt .RandBytes (s .uuidSize )
572+ uuid = crypt .RandBytes (s .uuidSize )
571573 _ , hasID = s .clients .Get (string (uuid ))
572574 }
573575
@@ -583,7 +585,7 @@ func gzip(b *[]byte) {
583585 if ! GzipEnabled {
584586 return
585587 }
586- if comp , err := goutil . GZIP .Zip (* b ); err == nil {
588+ if comp , err := goutil_GZIP .Zip (* b ); err == nil {
587589 * b = []byte (base64 .StdEncoding .EncodeToString (comp ))
588590 }
589591}
@@ -593,7 +595,7 @@ func gunzip(b *[]byte) {
593595 return
594596 }
595597 if dec , err := base64 .StdEncoding .DecodeString (string (* b )); err == nil {
596- if dec , err = goutil . GZIP .UnZip (dec ); err == nil {
598+ if dec , err = goutil_GZIP .UnZip (dec ); err == nil {
597599 * b = dec
598600 }
599601 }
0 commit comments