mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
fix: Move more directories
This commit is contained in:
17
cloud/packages/maitred/internal/realtime/utils.go
Normal file
17
cloud/packages/maitred/internal/realtime/utils.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package realtime
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"github.com/oklog/ulid/v2"
|
||||
"time"
|
||||
)
|
||||
|
||||
func generateClientID() string {
|
||||
// Create a source of entropy (cryptographically secure)
|
||||
entropy := ulid.Monotonic(rand.Reader, 0)
|
||||
// Generate a new ULID
|
||||
id := ulid.MustNew(ulid.Timestamp(time.Now()), entropy)
|
||||
// Create the client ID string
|
||||
return fmt.Sprintf("mch_%s", id.String())
|
||||
}
|
||||
Reference in New Issue
Block a user