Skip to content

Instantly share code, notes, and snippets.

@schweigert
Created December 28, 2018 02:36
Show Gist options
  • Save schweigert/3f82e17b9b2a3e4e1f5b062fd2dc815a to your computer and use it in GitHub Desktop.
Save schweigert/3f82e17b9b2a3e4e1f5b062fd2dc815a to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"crypto/sha256"
"encoding/hex"
)
func main() {
s := "123123"
h := sha256.New()
h.Write([]byte(s))
sha256_hash := hex.EncodeToString(h.Sum(nil))
fmt.Println(s, sha256_hash)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment