Migrat pkg/password to using pkglib package

This commit is contained in:
Tom Wiesing 2023-02-26 10:24:06 +01:00
parent 010fd536ea
commit aa3580c248
No known key found for this signature in database
11 changed files with 56 additions and 158 deletions

View file

@ -1,8 +1,13 @@
package config
import "github.com/FAU-CDI/wisski-distillery/pkg/password"
import (
"crypto/rand"
"github.com/FAU-CDI/wisski-distillery/internal/passwordx"
"github.com/tkw1536/pkglib/password"
)
// NewPassword returns a new password using the password settings from this configuration
func (cfg Config) NewPassword() (string, error) {
return password.Password(cfg.PasswordLength)
return password.Generate(rand.Reader, cfg.PasswordLength, passwordx.Charset)
}