15 lines
205 B
Go
15 lines
205 B
Go
package sha512x
|
|
|
|
import (
|
|
"crypto/sha512"
|
|
"encoding/hex"
|
|
)
|
|
|
|
// Sha512加密
|
|
func Sha512(src string) string {
|
|
m := sha512.New()
|
|
m.Write([]byte(src))
|
|
res := hex.EncodeToString(m.Sum(nil))
|
|
return res
|
|
}
|