20 January 2020 01:01:50 PM
LUHN_TEST
C version
Test the LUHN library.
CH_IS_DIGIT_TEST
CH_IS_DIGIT is TRUE if a character represents a digit.
C CH_IS_DIGIT(C)
0 '0' 1
1 '1' 1
2 '2' 1
3 '3' 1
4 '4' 1
5 '5' 1
6 '6' 1
7 '7' 1
8 '8' 1
9 '9' 1
10 'X' 0
11 '?' 0
12 ' ' 0
CH_TO_DIGIT_TEST
CH_TO_DIGIT: character -> decimal digit
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 X -1
11 ? -1
12 -1
S_DIGITS_COUNT_TEST
S_DIGITS_COUNT counts the digits in a string.
We count 7 digits in '34E94-70.6'
We count 0 digits in 'Not a one!'
We count 3 digits in '!8*k >>>> & SEVEN-0.3'
S_TO_DIGITS_TEST
S_TO_DIGITS: string -> digit vector
Test string: '34E94-70.6'
Extracted 5 digits:
0: 3
1: 4
2: 9
3: 4
4: 7
Test string: '34E94-70.6'
Extracted 7 digits:
0: 3
1: 4
2: 9
3: 4
4: 7
5: 0
6: 6
LUHN_CHECK_DIGIT_CALCULATE_TEST
LUHN_CHECK_DIGIT_CALCULATE calculates the check digit
for a string of digits
Check digit of '7992739871' is 3, expecting 3
Check digit of '9876234510' is 0, expecting 0
Check digit of '246897531' is 9, expecting 9
Check digit of '135798642' is 9, expecting 9
LUHN_IS_VALID_TEST
LUHN_IS_VALID determines whether a string with final
Luhn check digit is valid.
Validity of '79927398713' is 1, expecting 1
Validity of '79924398713' is 0, expecting 0
Validity of '79927398711' is 0, expecting 0
LUHN_TEST
Normal end of execution.
20 January 2020 01:01:50 PM
没有合适的资源?快使用搜索试试~ 我知道了~
C 代码 计算字符串的 Luhn 校验位,或验证字符串, 用于信用卡号中的错误检测.rar
共6个文件
sh:2个
c:2个
txt:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 174 浏览量
2023-05-27
00:52:27
上传
评论
收藏 5KB RAR 举报
温馨提示
C实用代码
资源推荐
资源详情
资源评论
收起资源包目录
C 代码 计算字符串的 Luhn 校验位,或验证字符串, 用于信用卡号中的错误检测.rar (6个子文件)
luhn
luhn.sh 195B
luhn.h 303B
luhn.c 8KB
luhn_test
luhn_test.c 7KB
luhn_test.sh 366B
luhn_test.txt 2KB
共 6 条
- 1
资源评论
卷积神经网络
- 粉丝: 338
- 资源: 8460
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功