Add rubocop to our build. (#5004)

This commit is contained in:
Guo Xiang Tan
2017-07-28 10:20:09 +09:00
committed by GitHub
parent ff4e295c4f
commit 5012d46cbd
871 changed files with 5480 additions and 6056 deletions

View File

@ -20,18 +20,18 @@ class Pbkdf2
u = ret = prf(h, password, salt + [1].pack("N"))
2.upto(iterations) do
u = prf(h, password, u)
u = prf(h, password, u)
ret.xor!(u)
end
ret.bytes.map{|b| ("0" + b.to_s(16))[-2..-1]}.join("")
ret.bytes.map { |b| ("0" + b.to_s(16))[-2..-1] }.join("")
end
protected
# fallback xor in case we need it for jruby ... way slower
def self.xor(x,y)
x.bytes.zip(y.bytes).map{|x,y| x ^ y}.pack('c*')
def self.xor(x, y)
x.bytes.zip(y.bytes).map { |x, y| x ^ y }.pack('c*')
end
def self.prf(hash_function, password, data)