Can Credit Card Numbers contain leading zeros? [closed]

流过昼夜 提交于 2019-11-30 22:10:39

According to Wikipedia, the first digit can indeed be 0:

The first digit of a credit card number is the Major Industry Identifier (MII), which represents the category of entity which issued the credit card. Different MII digits represent the following issuer categories:

  • 0 – ISO/TC 68 and other future industry assignments
  • etc.

So no, I don't think you'd want to use storage that omits leading zeros.

Credit card numbers (like phone numbers and postal codes) are not numeric and should never be stored in a numeric datatype. They are inherently string data. Numbers that are not intended to be used in mathematical calculations (except autoassigned integers that are used as ids) are string data, they will be used as string data, they will be queried as string data.

They can. The first number of a credit card is it's Major Industry Identifier, which tells you what sort of entity issued the card. All ten digits are used, including zero. The first six digits overall form the issuer identifier, and I do not believe they restrict 0, as Discover begins with 6011.

Credit Card Numbering

Only ISO/TC 68 credit cards start with leading zeros (see also the Wikipedia entry for ISO/IEC 7812). So it seems that they'd be very rare, but possibly existing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!