package auth import ( "crypto/sha256" "encoding/hex" ) // HashToken returns the hex-encoded SHA-256 hash of a token string. // Used by both the token creation handler and the auth middleware. func HashToken(token string) string { h := sha256.Sum256([]byte(token)) return hex.EncodeToString(h[:]) }