A simple gem to scan a string, find and mask mastercard, visa and verve credit/debit card pans.
-
Add pan_masker to your Gemfile as you normally would do with any bundler powered gem.
gem 'pan_masker'
-
Run a bundle install on your project
bundle install
-
Require pan_masker in your controller or helper classes
require 'pan_masker'
-
Find and mask all card type pans found in string supplied
Pan_masker.mask('string to be scanned')
-
Find and mask specific card type pans
Pan_masker.mask('string to be scanned','card type')
###Supported card types
Mastercard , Visa , Verve , Maestro and ChinaUnionPay
The gem scans a string block for pans of lenght 16 (mastercard and visa) and 19 and masks them