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
+1 -2
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() {