bankcard-validator
v1.0.8
Published
verify bank card number base on Luhn algorithm
Downloads
18
Maintainers
Readme
bankcard-validator
功能介绍: 1、Luhn算法(模10算法)检验银行卡号正确性 2、批量生成符合规则的银行卡号
Try
Install
$ npm install bankcard-validator
import bcValidator from 'bankcard-validator';
bcValidator('银行卡号')
or
<script type="text/javascript" src='pathTo/bcValidator.js'></script>
<script>
/**
* @param {String} bankcard
* @return {Boolean}
* /
bcValidator('银行卡号')
</script>
<script type="text/javascript" src='pathTo/bcBuilder.js'></script>
<script>
/**
* @param {Number} num 生成银行卡个数
* @return {Array} 如:[['6226322493250925', '华夏银行(借记卡)']]
* /
bcBuilder(20)
</script>
Tests
$ npm test