根据输入的号码显示信用卡图像

发布于 2024-10-20 07:54:59 字数 98 浏览 1 评论 0原文

有人有根据输入的卡号动态显示信用卡图像的经验吗?

是否有某种可用的列表来运行 if then 来将图像设置为可见或隐藏?

任何帮助/建议表示赞赏 谢谢

Anyone have any experience with displaying a credit card image dynamically based on the card number entered?

Is there some sort of usable list to run an if then against to set an image to visible or hidden?

Any help/advice is appreciated
Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生来就爱笑 2024-10-27 07:54:59

根据维基百科

卡号的前六位数字(包括开头的MII)
数字)被称为发行人识别号(IIN)。这些
识别该卡的发卡机构
持有者。其余数量由发卡机构分配。

接下来是 IIN 表格,它揭示了这个问题的许多秘密:它实际上最多六位数字,通常是一位、三位或四位。例如,如果以 4 开头,则它是 VISA(或联名 Dankort 卡),除非前四位数字是 4903、4905、4911 或 4936,在这种情况下它是 Switch 借记卡。但是切换卡不再存在; 2002 年,它们被出售给万事达卡,更名为 Maestro,并发行了新卡。然而,某人的孩子可能会从阁楼上挖出一个并尝试使用它。

这在逻辑上没有什么困难或聪明的地方。它只是对不同长度的前缀的一系列比较。合理的实现是一系列子字符串或正则表达式比较,if/else/else/else 等。

trie< /a> 写起来会更有趣,但是将这种代码留给潜在无能(或只是忙碌)的继任者来维护并不是真正的板球。

According to Wikipedia,

The first six digits of a card number (including the initial MII
digit) are known as the issuer identification number (IIN). These
identify the card issuing institution that issued the card to the card
holder. The rest of the number is allocated by the card issuer.

This is followed by table of IIN's which sheds much darkness on the matter: It's really up to six digits, usually one, three, or four. For example, if it starts with 4, it's a VISA (or a co-branded Dankort card), unless the first four digits are 4903, 4905, 4911, or 4936, in which case it's a Switch debit card. But Switch cards no longer exist; they were sold to MasterCard in 2002, rebranded as Maestro, and new cards were issued. Nevertheless somebody's kid may dig one out of the attic and try to use it.

There's nothing logically difficult or clever about it; it's just a series of comparisons to prefixes of varying lengths. The sensible implementation would be a series of substring or regex comparisons, if/else/else/else etc.

A trie would be much more fun to write but it's not really cricket to leave that kind of code for potentially incompetent (or just busy) successors to maintain.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文