diff --git a/auth/auth.go b/auth/auth.go index 8a5bc92..d6a5c5a 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -12,6 +12,8 @@ import ( "strings" "time" "unicode" + + "github.com/google/uuid" ) const ( @@ -85,7 +87,7 @@ func Authenticate(username string, password string) (int32, string, bool) { // THE FUNNY THING // for range 2500000 { // secrets = append(secrets, entries.Secret{ - // ID: security.RandBase58String(32), + // ID: uuid.New().String() // Description: "some website", // URL: "https://example.com", // Notes: "test notes something here i like writing notes lalalalala test test", diff --git a/cmd/passgen/main.go b/cmd/passgen/main.go index 43699fe..c94daeb 100644 --- a/cmd/passgen/main.go +++ b/cmd/passgen/main.go @@ -4,6 +4,8 @@ import ( "maxwarden/entries" "maxwarden/security" "os" + + "github.com/google/uuid" ) func main() { @@ -13,7 +15,7 @@ func main() { testData := []entries.Secret{} for range 10 { - dummyData := entries.Secret{ID: security.RandBase58String(32), Description: "Twitter / X.com", URL: "https://x.com", Notes: "2fa is enabled for this account.", Username: "@johntwitter", Password: "##CORRECT_HORSE_BATTERY_STAPLE_51"} + dummyData := entries.Secret{ID: uuid.New().String(), Description: "Twitter / X.com", URL: "https://x.com", Notes: "2fa is enabled for this account.", Username: "@johntwitter", Password: "##CORRECT_HORSE_BATTERY_STAPLE_51"} testData = append(testData, dummyData) } diff --git a/entries/entries.go b/entries/entries.go index a5e3739..cc85dd5 100644 --- a/entries/entries.go +++ b/entries/entries.go @@ -8,6 +8,8 @@ import ( "sort" "strings" "time" + + "github.com/google/uuid" ) type Secret struct { @@ -163,7 +165,7 @@ func Add(userId int32, masterKey string, secret Secret) error { return errors.New("user secrets are null") } - secret.ID = security.RandBase58String(32) + secret.ID = uuid.New().String() secret.Modified = time.Now() secret.Created = time.Now()