package
Version:
v0.9.0
Opens a new window with list of versions in this module.
Published: Dec 5, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package luhn 模 10 校验算法
1. 从右往左,偶数位数字乘以 2,如果是两位数,将其个位数和十位数相加;
2. 将以上的所有数值相加得到值 n1;
3. 从右往左,奇数位的数值加相加得到值 n2;
4. (n1+n2) % 10 如果值为 0,表示正确。
Build 为 prefix 生成最后一位校验位形成正确的字符串
Source Files
¶
Click to show internal directories.
Click to hide internal directories.