Created
December 6, 2022 03:14
-
-
Save joshbeard/dccf8458d966b5c59dd9988caec392eb to your computer and use it in GitHub Desktop.
Go: sha512 checksum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/sha512" | |
"fmt" | |
) | |
// shaSum returns a SHA512 checksum of a string. | |
func shaSum(s string) string { | |
sha_512 := sha512.New() | |
sha_512.Write([]byte(s)) | |
sum := fmt.Sprintf("%x", sha_512.Sum(nil)) | |
return sum | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment