Skip to content

Commit

Permalink
Merge pull request astaxie#211 from slene/patch-1
Browse files Browse the repository at this point in the history
fix wrong result
  • Loading branch information
astaxie committed Apr 24, 2015
2 parents feff646 + 07a2859 commit 855e649
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 855e649

Please sign in to comment.