social_security_number 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 378d7a24acce37a5892f40b48ee957780f883e02
|
4
|
+
data.tar.gz: d921f7b1548049a44e2e9ef6ab1fa7d34b68f6b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d76a21a8530caf46b2d6e87e6c10581d71b59987577779a421f4f75d8bcabb319537ad00effa5e8866d5e18f03b2da726b800851757a30272ece668f85606c93
|
7
|
+
data.tar.gz: bcc2bbae831a6fa32c6ccc81ba7c50d9252bf40cf4ad9df4c5f7a309f948eaee954abd2961b925b0b8d8029c2227d35fb5e3be07e3f952ad647fe732e0457df4
|
@@ -43,7 +43,7 @@ module SocialSecurityNumber
|
|
43
43
|
def checksum(operation)
|
44
44
|
i = 0
|
45
45
|
compare_method = operation == :even ? :== : :>
|
46
|
-
digit_number[
|
46
|
+
digit_number[2..10].reverse.split('').reduce(0) do |sum, c|
|
47
47
|
n = c.to_i
|
48
48
|
weight = (i % 2).send(compare_method, 0) ? n * 2 : n
|
49
49
|
i += 1
|