Skip to content

Latest commit

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pan

Cares about PANs (Primary Account Number).

Build statusCode ClimateLicense

Examples

require'pan'pan='1234567890123456'Pan.mask(pan)#=> '123456******3456'pan#=> '1234567890123456'Pan.truncate(pan)#=> '123456******3456'pan#=> '123456******3456'

(Yes, that's the difference between masking and truncating a PAN in PCI DSS terminology.)

You may decide how much to mask (or truncate) and the character(s) that the digits are replaced with:

Pan.template=[0,'x',4]Pan.mask('1234567890123456')#=> 'xxxxxxxxxxxx3456'
pan='1234567890123456'Pan.mask(pan,template: [4,'X',4])#=> '1234XXXXXXXX3456'Pan.truncate(pan,template: [6,'*',4]);pan#=> '123456******3456'

About

Cares about PANs (credit card numbers)

Resources

Stars

2 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages