first commit

This commit is contained in:
2026-08-08 20:36:24 +02:00
commit e3ca632883
8 changed files with 1267 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package orm
import (
"crypto/rand"
"encoding/hex"
"github.com/sixafter/nanoid"
)
func GenID() string {
id, err := nanoid.New()
if err != nil {
// Fallback to random hex
b := make([]byte, 16)
if _, err := rand.Read(b); err != nil {
return "fallback-id"
}
return hex.EncodeToString(b)
}
return id.String()
}