ch4: fix code path

This commit is contained in:
chai2010
2016-01-20 23:36:24 +08:00
parent ca0f87fad9
commit 3666d2f0e8
9 changed files with 16 additions and 30 deletions

View File

@@ -80,9 +80,8 @@ fmt.Println(a == d) // compile error: cannot compare [2]int == [3]int
作爲一個眞實的例子crypto/sha256包的Sum256函數對一個任意的字節slice類型的數據生成一個對應的消息摘要。消息摘要有256bit大小因此對應[32]byte數組類型。如果兩個消息摘要是相同的那麽可以認爲兩個消息本身也是相同譯註理論上有HASH碼碰撞的情況但是實際應用可以基本忽略如果消息摘要不同那麽消息本身必然也是不同的。下面的例子用SHA256算法分别生成“x”和“X”兩個信息的摘要
<u><i>gopl.io/ch4/sha256</i></u>
```Go
gopl.io/ch4/sha256
import "crypto/sha256"
func main() {