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.

27 lines
815 B

  1. FastGoSkein
  2. ===========
  3. A go port of the skein hash function originally written in C from https://github.com/cberner/xkcd_miner. Ive made a few tweaks an optimizations on the original code for added performance.
  4. Note: Its still not as fast as the original, but I will continue to chip away at optimizations as much as I can!
  5. #Use:
  6. Install the package with `go get`
  7. go get github.com/whyrusleeping/FastGoSkein
  8. Import it in your golang code
  9. import "github.com/whyrusleeping/FastGoSkein"
  10. And use it!
  11. toHash := []byte("This is a super secret keyphrase to be hashed!")
  12. sk := new(skein.Skein1024)
  13. sk.Init(1024)
  14. sk.Update(toHash)
  15. outputBuffer := make([]byte, 128)
  16. sk.Final(outputBuffer)
  17. //Nice hex formatting from encoding/hex
  18. fmt.Println(hex.EncodeToString(outputBuffer))