mirror of
https://github.com/TwiN/gatus.git
synced 2024-12-01 04:14:20 +01:00
14 lines
264 B
Go
14 lines
264 B
Go
package security
|
|
|
|
import (
|
|
"crypto/sha512"
|
|
"fmt"
|
|
)
|
|
|
|
// Sha512 hashes a provided string using SHA512 and returns the resulting hash as a string
|
|
func Sha512(s string) string {
|
|
hash := sha512.New()
|
|
hash.Write([]byte(s))
|
|
return fmt.Sprintf("%x", hash.Sum(nil))
|
|
}
|