gpt4 book ai didi

asp.net - 解析来自磁条的信用卡输入

转载 作者:行者123 更新时间:2023-12-03 02:24:36 25 4
gpt4 key购买 nike

有人知道如何解析从磁卡刷卡器输入的信用卡字符串吗?

我尝试了 JavaScript 解析器,但从未让它工作。这就是输入的样子。

%BNNNNNNNNNNNNNNNN^DOE/JOHN
^1210201901000101000100061000000?;NNNNNNNNNNNNNNNN=12102019010106111001?

N 是信用卡号。

最佳答案

请参阅Magnetic Stripe Card entry @ Wikipedia :

<小时/>

Track one, Format B:

  • Start sentinel — one character (generally '%')
  • Format code="B" — one character (alpha only)
  • Primary account number (PAN) — up to 19 characters. Usually, but not always, matches the credit card number printed on the front of the card.
  • Field Separator — one character (generally '^')
  • Name — two to 26 characters
  • Field Separator — one character (generally '^')
  • Expiration date — four characters in the form YYMM.
  • Service code — three characters
  • Discretionary data — may include Pin Verification Key Indicator (PVKI, 1 character), PIN Verification Value (PVV, 4 characters), Card Verification Value or Card Verification Code (CVV or CVK, 3 characters)
  • End sentinel — one character (generally '?')
  • Longitudinal redundancy check (LRC) — one character (Most reader devices do not return this value when the card is swiped to the presentation layer, and use it only to verify the input internally to the reader.)
<小时/>

我希望数据是假的,否则任何人都可以得到:

  • 姓名
  • 到期日期
  • CVV

我不确定,但我认为可以使用 LRC 计算信用卡号(或可能性的数量)。

关于asp.net - 解析来自磁条的信用卡输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2121881/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com