Created
May 10, 2019 07:09
-
-
Save touhonoob/755e137ae67758f5c247c8432be1d821 to your computer and use it in GitHub Desktop.
Revisions
-
touhonoob created this gist
May 10, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ package main import ( "crypto/sha256" "encoding/hex" "fmt" ) func main() { right := "3187c721dc9913aef26a6cf1677a29a0c1c24229730911e68091eadf8839873" data := make([]byte, 64) right_bytes, _ := hex.DecodeString(right) copy(data[32:], right_bytes) hashed_with_empty_bytes := sha256.Sum256(data) fmt.Printf("with empty bytes: %s\n", hex.EncodeToString(hashed_with_empty_bytes[:])) hashed_without_empty_bytes := sha256.Sum256(right_bytes) fmt.Printf("without empty bytes: %s\n", hex.EncodeToString(hashed_without_empty_bytes[:])) }