TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Making sense of your credit card

48 点作者 varunkumar超过 14 年前

6 条评论

pmorici超过 14 年前
The original was posted a few days ago, <a href="http://www.mint.com/blog/trends/credit-card-code-01202011/" rel="nofollow">http://www.mint.com/blog/trends/credit-card-code-01202011/</a> this article really doesn't add anything.
corin_超过 14 年前
I feel I'm being moronic, and will come back to this in an hour or so once I've finished some work and do the maths again... but I've checked with four cards (two credit cards, two debit cards, all VISA) and none of them result in a number divisible by ten. Results were 107, 98, 107, 106.<p>Having read <a href="http://en.wikipedia.org/wiki/Luhn_algorithm" rel="nofollow">http://en.wikipedia.org/wiki/Luhn_algorithm</a> I'm either doing it right, or I'm way more tired than I thought. Each card number is 16 digits long, so for (from the left) digits 1, 3, etc. I double them, then I add the sum of those doubles to digits 2, 4, etc.<p>i.e.<p><pre><code> 1234 1234 1234 1234 </code></pre> Would be:<p><pre><code> ((1 * 2) + 2 + (3 * 2) + 4) * 4 </code></pre> I feel really dumb for writing that out given it's already written out in this article, and on Wikipedia, but either I <i>am</i> being really dumb or my four cards are all invalid.<p>EDIT: Here is an old card number (card is long expired), and to be safe I've swapped various numbers around (but only swapped even position numbers with each other, and odd position numbers with each other, so it shouldn't effect the check sum). Could someone kindly tell me if I'm being an idiot?<p><pre><code> 5658 4612 3826 9730</code></pre>
评论 #2134794 未加载
评论 #2134783 未加载
ffffruit超过 14 年前
I was under the impression that credit companies relied on the insanely big number of possible combinations in order to protect them selves. You can surely create a billion "valid" credit card numbers but the probability of a portion of them being in-use is very low.
评论 #2135020 未加载
Sniffnoy超过 14 年前
That's a weird way of doing checksums. Summing digits preserves residues mod 9, yet the final check is mod 10. Weird.<p>(Now how do the 3 additional verification digits on the back work?)
评论 #2134798 未加载
doki_pen超过 14 年前
I wrote this for a site I worked on. It uses prototype.js.<p><a href="https://gist.github.com/271597" rel="nofollow">https://gist.github.com/271597</a>
mcantelon超过 14 年前
&#62;9 is national assignment<p>...as in state applications, like national ID cards?
评论 #2134776 未加载