We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5536f21 commit 3bab183Copy full SHA for 3bab183
net.coffee
@@ -1063,20 +1063,21 @@ class TcpConnection extends Connection
1063
pbkdf2_cache[cache_string] = u
1064
return u
1065
1066
+ # a, b should be strings
1067
compare_digest = (a, b) ->
1068
left = undefined
1069
right = b
1070
result = undefined
1071
if a.length is b.length
1072
left = a
1073
result = 0
- else
1074
+ if a.length != b.length
1075
left = b
1076
result = 1
1077
- len = Math.min(a.length, b.length)
1078
+ len = Math.min(left.length, right.length)
1079
for i in [0...len]
- result |= xor_bytes(a[i],b[i])
1080
+ result |= left[i] ^ right[i]
1081
1082
return result is 0
1083
0 commit comments