Created
June 26, 2013 12:14
-
-
Save saward/5866928 to your computer and use it in GitHub Desktop.
go crypt test
This file contains 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
package main | |
import ( | |
"crypto/md5" | |
"hash" | |
"fmt" | |
"io" | |
) | |
const loops = 5000000 | |
const crypstring = "The fog is getting thicker!" | |
func many_hashes(h Hash) { | |
fmt.Printf("Start md5's\n") | |
for i:= 0; i < loops; i++ { | |
io.WriteString(h, crypstring) | |
_ = h.Sum(nil) | |
} | |
fmt.Printf("End md5's\n") | |
} | |
func main() { | |
hash := md5.New() | |
many_hashes(hash) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment