use UUIDs now
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user