Created
September 14, 2024 17:28
-
-
Save devlongs/4b6eba2e2b3d3418582f71d0e718d1b1 to your computer and use it in GitHub Desktop.
Hashing in Go using the crypto/sha256 library
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/sha256" | |
"fmt" | |
) | |
func main() { | |
hash := sha256.New() | |
hash.Write([]byte("Hello, World!")) | |
hashed := hash.Sum(nil) | |
fmt.Printf("hashed value: %x\n", hashed) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment