Skip to content

Commit ad0c6d5

Browse files
committed
chore: upgrade standard packages
1 parent a04e89c commit ad0c6d5

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

hems/ocpp/ocpp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package ocpp
22

33
import (
44
"fmt"
5-
"math/rand"
5+
"math/rand/v2"
66
"strings"
77
"time"
88

@@ -43,7 +43,7 @@ func New(conf map[string]interface{}, site site.API) (*OCPP, error) {
4343
if err == nil {
4444
cc.StationID = fmt.Sprintf("evcc-%s", strings.ToLower(id))
4545
} else {
46-
cc.StationID = fmt.Sprintf("evcc-%d", rand.Int31())
46+
cc.StationID = fmt.Sprintf("evcc-%d", rand.Uint32())
4747
}
4848
log.DEBUG.Println("station id:", cc.StationID)
4949
}

provider/mqtt/client.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package mqtt
33
import (
44
"crypto/tls"
55
"fmt"
6-
"math/rand"
6+
"math/rand/v2"
77
"strings"
88
"sync"
99
"sync/atomic"
@@ -20,8 +20,7 @@ var Instance *Client
2020

2121
// ClientID created unique mqtt client id
2222
func ClientID() string {
23-
pid := rand.Int31()
24-
return fmt.Sprintf("evcc-%d", pid)
23+
return fmt.Sprintf("evcc-%d", rand.Uint32())
2524
}
2625

2726
// Config is the public configuration

0 commit comments

Comments
 (0)