From 7e9e301bfb3eaf4ad20844d18257099a4f7281aa Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Thu, 20 Jul 2023 17:58:25 +0200 Subject: [PATCH] Front-End Stuff --- utils.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils.go b/utils.go index 3b4ec6d..c8a9771 100644 --- a/utils.go +++ b/utils.go @@ -7,8 +7,8 @@ import ( "github.com/go-ldap/ldap/v3" // "bytes" // "crypto/rand" - // "encoding/binary" - "encoding/hex" + "encoding/binary" + // "encoding/hex" // "fmt" // "html/template" // "log" @@ -43,9 +43,9 @@ func openLdap(config ConfigFile) *ldap.Conn { } } -func suggestPassword() string { +func suggestPassword() uint32 { random := make([]byte, 32) - return hex.EncodeToString(random[0:4]) + return binary.BigEndian.Uint32(random[0:12]) } func addNewUser(newUser NewUser, config *ConfigFile, login *LoginStatus) bool {