[2016][ruby][5.x] shameless green

profile
Alpha Chen 8 years ago
parent 9fdfa3d687
commit b501d324af

@ -0,0 +1,22 @@
require 'digest/md5'
door_id = 'wtnhxymk'
password = Array.new(8, nil)
VALID = (0..7).map(&:to_s).to_a
index = 0
while password.any?(&:nil?)
puts index if index % 1000000 == 0
hash = Digest::MD5.hexdigest("#{door_id}#{index}")
if hash.start_with?('00000')
i = hash[5]
if VALID.include?(i) && password[i.to_i].nil?
password[i.to_i] = hash[6]
p hash, password
end
end
index += 1
end
puts password.join
Loading…
Cancel
Save