credit_card_sanitizer 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/credit_card_sanitizer.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28ed93f321fb1d41a484c6f85820fc5385770ca2
|
4
|
+
data.tar.gz: fb8b5ca8f5e870efe6e9eed5aa5f7faea1bcb007
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8262f4023050479062a2a2d6b2d96f4139fe0c59a96002770ea6b0f8ea5abdf611dfd8f1f6a04d2e20c17a9e850f573719d6da7e2f5f63301988c2cf1c0bc29
|
7
|
+
data.tar.gz: 0eb8614233afc3d5f2edbda167b06f9e12074ac09d6bb6006a3d0c1cd40c55442f79f5a48c43c83f6f78a5b9f62a603cf37f4e8f89185aa7d4019332018af06c
|
@@ -4,8 +4,9 @@ require 'luhn_checksum'
|
|
4
4
|
|
5
5
|
class CreditCardSanitizer
|
6
6
|
|
7
|
+
LINE_NOISE = /[^\w_\n,()]{0,8}/x
|
7
8
|
# 12-19 digits explanation: https://en.wikipedia.org/wiki/Primary_Account_Number#Issuer_identification_number_.28IIN.29
|
8
|
-
NUMBERS_WITH_LINE_NOISE = /\d(
|
9
|
+
NUMBERS_WITH_LINE_NOISE = /\d(?:#{LINE_NOISE}\d#{LINE_NOISE}){10,17}\d/x
|
9
10
|
|
10
11
|
def self.parameter_filter
|
11
12
|
Proc.new { |_, value| new.sanitize!(value) if value.is_a?(String) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: credit_card_sanitizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Chapweske
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-09-
|
13
|
+
date: 2014-09-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: appraisal
|