mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-12 21:20:07 +00:00
13 lines
197 B
Go
13 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))
|
||
|
}
|