Created
September 20, 2012 12:01
-
-
Save dchest/3755498 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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