Mike Schwörer 1c374c6571
Some checks failed
Build Docker and Deploy / Build Docker Container (push) Has been cancelled
Build Docker and Deploy / Run Unit-Tests (push) Has been cancelled
Build Docker and Deploy / Deploy to Server (push) Has been cancelled
Update goext|gognecht dependencies to new module-root 'git.blackforestbytes'
2025-05-03 16:53:27 +02:00

25 lines
505 B
Go

package server
import (
"git.blackforestbytes.com/BlackForestBytes/goext/timeext"
"math/rand"
"time"
)
func QuotaDayString() string {
return time.Now().In(timeext.TimezoneBerlin).Format("2006-01-02")
}
func NextDeliveryTimestamp(now time.Time) time.Time {
return now.Add(5 * time.Second)
}
func RandomAuthKey() string {
charset := "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
k := ""
for i := 0; i < 64; i++ {
k += string(charset[rand.Int()%len(charset)])
}
return k
}