初始化仓库

This commit is contained in:
2026-06-02 23:14:41 +08:00
commit 0bc3f02670
520 changed files with 191097 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
package core
import (
"crypto/rand"
"encoding/hex"
"fmt"
"time"
)
// GenerateToken creates a random hex token.
func GenerateToken(n int) string {
b := make([]byte, n)
if _, err := rand.Read(b); err != nil {
return fmt.Sprintf("cc-connect-%d", time.Now().UnixNano())
}
return hex.EncodeToString(b)
}