Skip to content

Commit

Permalink
fix wrong result
Browse files Browse the repository at this point in the history
  • Loading branch information
slene committed Apr 24, 2015
1 parent feff646 commit 07a2859
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/subtle/ConstantTimeCompare.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 07a2859

Please sign in to comment.