Created
February 13, 2019 16:50
-
-
Save jabgibson/32776bcc44223326a7ee4a1cb8c3c6ca to your computer and use it in GitHub Desktop.
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" | |
"encoding/hex" | |
"fmt" | |
"os" | |
) | |
func main() { | |
args := os.Args | |
if len(args) != 2 { | |
fmt.Println("Need an argument to hash") | |
return | |
} | |
h := sha256.New() | |
h.Write([]byte(args[1])) | |
fmt.Println(hex.EncodeToString(h.Sum(nil))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment