Files
kalzu-value-store/utils/hash.go
ryyst f9965c8f9c refactor: extract SHA3 hashing utilities to utils/hash.go
- Move all SHA3-512 hashing functions to utils package
- Update import statements and function calls
- Maintain zero functional changes
- First step in systematic main.go refactoring

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 18:36:47 +03:00

25 lines
496 B
Go

package utils
import (
"encoding/hex"
"golang.org/x/crypto/sha3"
)
// SHA3-512 hashing utilities for Phase 2 authentication
func HashSHA3512(input string) string {
hasher := sha3.New512()
hasher.Write([]byte(input))
return hex.EncodeToString(hasher.Sum(nil))
}
func HashUserNickname(nickname string) string {
return HashSHA3512(nickname)
}
func HashGroupName(groupname string) string {
return HashSHA3512(groupname)
}
func HashToken(token string) string {
return HashSHA3512(token)
}