From 07a28595f7be2baa142c07e56ff1942b691088e9 Mon Sep 17 00:00:00 2001 From: Liu Peng Date: Fri, 24 Apr 2015 14:34:47 +0800 Subject: [PATCH] fix wrong result --- crypto/subtle/ConstantTimeCompare.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/subtle/ConstantTimeCompare.md b/crypto/subtle/ConstantTimeCompare.md index 9e090774..9472e78a 100644 --- a/crypto/subtle/ConstantTimeCompare.md +++ b/crypto/subtle/ConstantTimeCompare.md @@ -26,7 +26,7 @@ ConstantTimeCompare returns 1 if the two equal length slices, x and y, have equa func main() { fmt.Printf("%d\n", subtle.ConstantTimeCompare([]byte("lilei"), []byte("lilei"))) // 1 - fmt.Printf("%d\n", subtle.ConstantTimeCompare([]byte("lilei"), []byte("lilei2"))) // 1 + fmt.Printf("%d\n", subtle.ConstantTimeCompare([]byte("lilei"), []byte("lilei2"))) // 0 fmt.Printf("%d\n", subtle.ConstantTimeCompare([]byte("lilei"), []byte(" lilei"))) // 0 fmt.Printf("%d\n", subtle.ConstantTimeCompare([]byte("lilei "), []byte("liming"))) // 0 }