mirror of
https://github.com/stakater/Reloader.git
synced 2026-05-20 07:32:51 +00:00
17 lines
253 B
Go
17 lines
253 B
Go
package crypto
|
|
|
|
import (
|
|
"crypto/sha512"
|
|
"encoding/hex"
|
|
)
|
|
|
|
// GenerateSHA generates SHA from string
|
|
func GenerateSHA(data string) string {
|
|
if data == "" {
|
|
return ""
|
|
}
|
|
|
|
hash := sha512.Sum512_256([]byte(data))
|
|
return hex.EncodeToString(hash[:])
|
|
}
|