Skip to content

Commit

Permalink
Refactor Luhn Checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
jremes-foss authored and stympy committed Sep 8, 2016
1 parent 722e85d commit ed669f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/faker/code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def generate_imei

# Calculate the Luhn checksum of the values thus far
len_offset = (len + 1) % 2
for pos in (0..(len - 1))
(0..(len - 1)).each do |pos|
if (pos + len_offset) % 2 != 0
t = str[pos] * 2

Expand Down

0 comments on commit ed669f8

Please sign in to comment.