Skip to content

Instantly share code, notes, and snippets.

@dchest
Created September 20, 2012 12:01
Show Gist options
  • Select an option

  • Save dchest/3755498 to your computer and use it in GitHub Desktop.

Select an option

Save dchest/3755498 to your computer and use it in GitHub Desktop.
// standard interface
h := blake256.New() // or sha256.New(), or anything else
h.Write([]byte("hello"))
result := h.Sum(nil) // output 256-byte hash
// standard interface too
h := skein.NewHash(32)
h.Write([]byte("hello"))
result := h.Sum(nil) // output 256-byte hash
// but also any hash length via OutputReader
reader := h.OutputReader()
io.Copy(os.Stdout, reader) // output "infinite"-length hash to stdout until killed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment