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>
This commit is contained in:
1 parent
7d7e6e412a
commit
f9965c8f9c
4 files changed
+134
-25
No files matched your search
@@ -0,0 +1,25 @@
|
||||
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)
|
||||
}
|
||||
Reference in new issue
Block a user