mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-08 10:11:08 +08:00
random string
update algorithm consolidate MakeRandomString, RandomString & GenerateCrytoString into one function
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
|
||||
"github.com/gravitl/netmaker/database"
|
||||
"github.com/gravitl/netmaker/models"
|
||||
"github.com/gravitl/netmaker/netclient/ncutils"
|
||||
)
|
||||
|
||||
// EnrollmentErrors - struct for holding EnrollmentKey error messages
|
||||
@@ -190,9 +189,9 @@ func getUniqueEnrollmentID() (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
newID := ncutils.MakeRandomString(models.EnrollmentKeyLength)
|
||||
newID := RandomString(models.EnrollmentKeyLength)
|
||||
for _, ok := currentKeys[newID]; ok; {
|
||||
newID = ncutils.MakeRandomString(models.EnrollmentKeyLength)
|
||||
newID = RandomString(models.EnrollmentKeyLength)
|
||||
}
|
||||
return newID, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user