// Package player provides shared identity types used across game packages. package player import ( "crypto/rand" "encoding/hex" ) // ID uniquely identifies a player within a session. For authenticated users // this is their user UUID; for guests it's a random hex string. type ID string // GenerateID returns a random hex string of 2*size characters. func GenerateID(size int) string { b := make([]byte, size) _, _ = rand.Read(b) return hex.EncodeToString(b) }