Advertisement
Guest User

Untitled

a guest
May 20th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "crypto/sha256"
  5. "encoding/hex"
  6. "fmt"
  7. )
  8.  
  9. func main() {
  10. right := "3187c721dc9913aef26a6cf1677a29a0c1c24229730911e68091eadf8839873"
  11. data := make([]byte, 64)
  12. right_bytes, _ := hex.DecodeString(right)
  13. copy(data[32:], right_bytes)
  14.  
  15. hashed_with_empty_bytes := sha256.Sum256(data)
  16. fmt.Printf("with empty bytes: %s\n", hex.EncodeToString(hashed_with_empty_bytes[:]))
  17.  
  18. hashed_without_empty_bytes := sha256.Sum256(right_bytes)
  19. fmt.Printf("without empty bytes: %s\n", hex.EncodeToString(hashed_without_empty_bytes[:]))
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement