fix: coding style and file format for chapter 11, 12, 13, 14 and 15.

This commit is contained in:
Bo-Yi Wu
2017-02-11 12:32:16 +08:00
parent c5413075c1
commit 4abbfabb52
63 changed files with 2662 additions and 2622 deletions

View File

@@ -1,20 +1,21 @@
// hash_md5.go
package main
import (
"fmt";
"crypto/md5"
"io"
)
func main() {
hasher := md5.New()
b := []byte{}
io.WriteString(hasher, "test")
fmt.Printf("Result: %x\n", hasher.Sum(b))
fmt.Printf("Result: %d\n", hasher.Sum(b))
}
/* Output:
Result: 098f6bcd4621d373cade4e832627b4f6
Result: [9 143 107 205 70 33 211 115 202 222 78 131 38 39 180 246]
*/
// hash_md5.go
package main
import (
"crypto/md5"
"fmt"
"io"
)
func main() {
hasher := md5.New()
b := []byte{}
io.WriteString(hasher, "test")
fmt.Printf("Result: %x\n", hasher.Sum(b))
fmt.Printf("Result: %d\n", hasher.Sum(b))
}
/* Output:
Result: 098f6bcd4621d373cade4e832627b4f6
Result: [9 143 107 205 70 33 211 115 202 222 78 131 38 39 180 246]
*/