chore: upgrade standard packages

This commit is contained in:
andig 2024-02-25 12:45:30 +01:00
parent a04e89cc87
commit ad0c6d5eb1
2 changed files with 4 additions and 5 deletions

View file

@ -2,7 +2,7 @@ package ocpp
import (
"fmt"
"math/rand"
"math/rand/v2"
"strings"
"time"
@ -43,7 +43,7 @@ func New(conf map[string]interface{}, site site.API) (*OCPP, error) {
if err == nil {
cc.StationID = fmt.Sprintf("evcc-%s", strings.ToLower(id))
} else {
cc.StationID = fmt.Sprintf("evcc-%d", rand.Int31())
cc.StationID = fmt.Sprintf("evcc-%d", rand.Uint32())
}
log.DEBUG.Println("station id:", cc.StationID)
}

View file

@ -3,7 +3,7 @@ package mqtt
import (
"crypto/tls"
"fmt"
"math/rand"
"math/rand/v2"
"strings"
"sync"
"sync/atomic"
@ -20,8 +20,7 @@ var Instance *Client
// ClientID created unique mqtt client id
func ClientID() string {
pid := rand.Int31()
return fmt.Sprintf("evcc-%d", pid)
return fmt.Sprintf("evcc-%d", rand.Uint32())
}
// Config is the public configuration