You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
298 B

  1. package crypto
  2. import (
  3. "crypto/sha256"
  4. "golang.org/x/crypto/ripemd160"
  5. )
  6. func Sha256(bytes []byte) []byte {
  7. hasher := sha256.New()
  8. hasher.Write(bytes)
  9. return hasher.Sum(nil)
  10. }
  11. func Ripemd160(bytes []byte) []byte {
  12. hasher := ripemd160.New()
  13. hasher.Write(bytes)
  14. return hasher.Sum(nil)
  15. }