forked from ryyst/kalzu-value-store
- 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>
25 lines
496 B
Go
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)
|
|
} |