upgrade deps; rewrite smtp session
This commit is contained in:
8
vendor/gitlab.com/etke.cc/go/secgen/password.go
generated
vendored
8
vendor/gitlab.com/etke.cc/go/secgen/password.go
generated
vendored
@@ -2,6 +2,7 @@ package secgen
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
"math/big"
|
||||
"strings"
|
||||
)
|
||||
@@ -20,3 +21,10 @@ func Password(length int) string {
|
||||
|
||||
return password.String()
|
||||
}
|
||||
|
||||
// Base64Bytes generates secure bytes with the given length and returns it as a base64 string
|
||||
func Base64Bytes(length int) string {
|
||||
randomBytes := make([]byte, length)
|
||||
rand.Read(randomBytes) //nolint:errcheck // nothing could be done anyway
|
||||
return base64.StdEncoding.EncodeToString(randomBytes)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user