Re: generating values

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Joe Celko (joe.celko_at_northface.edu)
Date: 02/16/04


Date: Mon, 16 Feb 2004 15:34:42 -0800

Can we assume that the credit card number is CHAR(16)?

Can we assume that "not real" also means "not valid"? That is, you have
no need to worry about check digits and other validations you'd have on
a real credit card number.

I assume you want to avoid proprietary code that will not port, such as
GUIDs. Burt we will have to use proprietary code that will port.

1) replace digits with other digits; REPLACE() is a common string
function.

UPDATE Foobar
  SET card_nbr
      = REPLACE (
          ...
         REPLACE (card_nbr, '0', '3')
          ...
         '9', '2');

2) generate a 16 digit random integer as cast it as a string; this can
be expensive.

3) cut it into substring and concatenate them together in a different
order.

4) overwrite the credit card number with other digits in the same row,
like telephone numbers.

--CELKO--
 ===========================
 Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • RE: form population macro
    ... MsgBox ("Invalid Credit Card Number") ... american express then 15 digits. ... that chooses, Visa, AE ...etc. and I want to have the entry cell change if it ... another is not different than copying data from one worksheet to another ...
    (microsoft.public.excel.programming)
  • RE: form population macro
    ... I'll try to be clearer on the credit card number issue. ... american express then 15 digits. ... that chooses, Visa, AE ...etc. and I want to have the entry cell change if it ... another is not different than copying data from one worksheet to another ...
    (microsoft.public.excel.programming)
  • Re: Frying and egg
    ... had to phone this customer many times so I could just dial the number ... were having trouble remembering their PIN codes because the finger ... Sometimes when I have to think what my credit card PIN code is, ... were written out as words rather than digits. ...
    (alt.usage.english)
  • Re: Looking for a certain regexp
    ... PG> context of credit card number validation. ... Regular expressions (especially Perl regular ... digits with appropriate modifications (add the digits of 2 digit ...
    (comp.lang.perl.misc)
  • RE: Using Snort to find creditcard data?
    ... Credit card numbers are typically 13 to 16 digits long. ... positives in snort. ... Using Snort to find creditcard data? ...
    (Focus-IDS)