lishwist/http/internal/id/generate.go
2025-08-26 20:02:15 +09:00

15 lines
204 B
Go

package id
import (
"crypto/rand"
"encoding/hex"
)
func Generate() string {
bytes := make([]byte, 16)
if _, err := rand.Read(bytes); err != nil {
panic(err)
}
return hex.EncodeToString(bytes)
}