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

标签 asp.net javascript parsing credit-card

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

我尝试了 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/

相关文章:

php - 将 ASCII 文件解析为 MySQL 表

c# - 是否有可用的 C#/asp.net 安全库?

javascript - Clojurescript、JavaScript、SVG、图表、图形

javascript - 如何删除多行 HTML 排列中的空格?

javascript - 单击 div 中除超链接之外的所有元素时如何切换 div 的显示?

python - 如何跳过行直到在txt文件中找到 'keyword'并将其余部分保存为csv? Python

c# - 无法在我的模型 View 模型类中引用 Url.content

c# - SQL 表根据带有存储过程的 IF 语句从另一个表获取信息

c# - 类构造函数错误

c# - 如何将月份名称(字符串)解析为整数以便在 C# 中进行比较?