mirror of
https://github.com/syntrex-lab/gomcp.git
synced 2026-05-08 19:12:37 +02:00
Release prep: 54 engines, self-hosted signatures, i18n, dashboard updates
This commit is contained in:
parent
694e32be26
commit
41cbfd6e0a
178 changed files with 36008 additions and 399 deletions
15
internal/domain/soc/id.go
Normal file
15
internal/domain/soc/id.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package soc
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// genID generates a collision-safe unique ID with the given prefix.
|
||||
// Uses crypto/rand for 8 random hex bytes instead of time.UnixNano
|
||||
// to prevent collisions under high concurrency.
|
||||
func genID(prefix string) string {
|
||||
b := make([]byte, 8)
|
||||
_, _ = rand.Read(b)
|
||||
return fmt.Sprintf("%s-%x", prefix, b)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue