Skip to content

Instantly share code, notes, and snippets.

@RaghavSood
Created April 27, 2018 08:09
Show Gist options
  • Save RaghavSood/e9e39cb5c258da67273c67c05b5ffdc1 to your computer and use it in GitHub Desktop.
Save RaghavSood/e9e39cb5c258da67273c67c05b5ffdc1 to your computer and use it in GitHub Desktop.
package main
import (
"crypto/sha256"
"encoding/hex"
"fmt"
"golang.org/x/crypto/ripemd160"
)
func main() {
input := []byte{0x51}
sum := sha256.Sum256(input)
hasher := ripemd160.New()
hasher.Write(sum[:])
hashBytes := hasher.Sum(nil)
encodedStr := hex.EncodeToString(hashBytes[:])
fmt.Println(encodedStr)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment