1996-02-22 - Re: Credit card numbers

Header Data

From: dlv@bwalk.dm.com (Dr. Dimitri Vulis)
To: cypherpunks@toad.com
Message Hash: b0e604a931d09d5a25304b17363e06513f1ffc29a6fb81876154e9b8bb250dcd
Message ID: <0JJoJD44w165w@bwalk.dm.com>
Reply To: <Pine.LNX.3.91.960221151336.13150A-100000@mixolydian.scranton.com>
UTC Datetime: 1996-02-22 03:26:14 UTC
Raw Date: Wed, 21 Feb 96 19:26:14 PST

Raw message

From: dlv@bwalk.dm.com (Dr. Dimitri Vulis)
Date: Wed, 21 Feb 96 19:26:14 PST
To: cypherpunks@toad.com
Subject: Re: Credit card numbers
In-Reply-To: <Pine.LNX.3.91.960221151336.13150A-100000@mixolydian.scranton.com>
Message-ID: <0JJoJD44w165w@bwalk.dm.com>
MIME-Version: 1.0
Content-Type: text/plain


> > Is there something like a checksum attached to Credit Card
> > Numbers. Or better: Is there a way to determine for a given
> > number N if
> >   -this _might_ be a valid number
> >   -this can't be a valid number

This was posted by Wayne D. Hoxsie Jr. <hoxsiew@crl.com>:

#include <stdio.h>

v(char *s)
{
  int i=0,j=0,k;

  k=!(!s[16]);
  for(;*s;*s++)
    i+=(++j%2-k)?(*s-'0')*2>9?((*s-'0')*2)-9:(*s-'0')*2:*s-'0';
  return (i%10);
}
main()
{
  char s[160];

  printf("Enter credit card number\n");
  scanf("%s",s);
  printf("Credit card number is %svalid\n",v(s)?"in":"");
}

---

Dr. Dimitri Vulis
Brighton Beach Boardwalk BBS, Forest Hills, N.Y.: +1-718-261-2013, 14.4Kbps





Thread