function isCreditCard(st) { // Encoding only works on cards with less than 19 digits if (st.length > 19) return (false); sum = 0; mul = 1; l = st.length; for (i = 0; i < l; i++) { digit = st.substring(l-i-1,l-i); tproduct = parseInt(digit ,10)*mul; if (tproduct >= 10) sum += (tproduct % 10) + 1; else sum += tproduct; if (mul == 1) mul++; else mul--; } if ((sum % 10) == 0) return (true); else return (false); }
file: /Techref/ecommerce/cc/jsverify.htm, 0KB, , updated: 1999/4/15 09:50, local time: 2025/1/8 14:16,
3.139.93.209:LOG IN
|
©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/techref/ecommerce/cc/jsverify.htm"> ecommerce cc jsverify</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.