3x-ui/util/crypto/crypto.go
2025-05-02 17:24:32 +03:00

12 lines
197 B
Go

package crypto
import (
"crypto/sha256"
"encoding/hex"
)
func HashSHA256(text string) string {
hasher := sha256.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}