What are credit card numbers
Technologies / / December 19, 2019
Any bank card has its own identifier - a unique 16-digit number. You would think that since people (and hence the card) so much, it is possible to cheat the system by entering invented combination of numbers when, for example, registering at some service, do not assume payment of the said cards right now. However, this trick does not work. The fact that credit card numbers are built on the basis of certain rules, and this allows us to calculate the accuracy of the existence of the entered card even without referring directly to the bank.
For example, when you specify a Visa card and the introduction of any of the first digit different from the Quartet, did not work. Numbers of all Visa cards start with the digit "4".
The vast majority of cards in Russia are issued by Visa and MasterCard payment systems. For them, we have the following combination of numbers at the beginning of the room:
- Visa: 4-
- MasterCard: 51- 52- 53- 54- 55-
Full list of bank cards prefixes, depending on the payment system can be found here.
Check sum
The reality is that, despite the proliferation of all kinds of applications, simplifying storage and input from the map data, people are very reluctant to store information in a form (and this has its meaning). As a result, we have to constantly enter the number of hands that will inevitably lead to human errors.
For instant detection of errors as you type, screening algorithms have been developed. The last digit in any credit card - is the result of the previous sequence of 15 digits, and it is always possible to "guess" if you know the first 15 digits, and Luhn algorithm.
In 1954, Hans Peter Moon has created an algorithm that later entered the international ISO / IEC 7812-1 standard, on the basis of which card numbers are being built.
The reason for choosing this algorithm became its simplicity and effectiveness. The ordinary man after two or three trial miscalculations can compute the check digit in the mind. In this case, the method is guaranteed to detect an error when you enter the wrong one-digit numbers. In addition, the algorithm detects almost all the random numbers paired replacement (typical human error when entering). But then there are also disadvantages. Checksum - only 1 digit. So, there is a 10% chance that a randomly generated number will be true for the algorithm.
Luhn algorithm works very simple and has only variation depending on the number of digits in the sequence (even or odd number of elements). Also offered creator numbered digits from right to left, but it is possible and so.
Initially we have a sequence of 16 digits.
Enumerate all the numbers from left to right. First and later through one digit multiplied by two, and if the product is greater than nine, then subtract 9 from it. As an option - add up the digits of the resulting two-digit number. It will be the same.
The resulting sequence is formed.
The result of reproduction must be a multiple of 10, otherwise the check digit is incorrect. To make it true to the original sequence, you need to increase it so that the amount after conversion is a multiple of 10.
there are more fancy checking algorithmsBut find them not so easy in his mind.
Other examples of use
Checksums are used everywhere. It allows you to instantly calculate the error when entering the important sequences of numbers. Bar codes, identification numbers of various personal documents in different countries - all using checksums. It is worth noting that the checksums are used throughout the electronics in general, where the integrity and safety of critical data reliability.
Parity
At the dawn of the era of computers, the memory in computers was not as reliable and periodically distorted data. Engineers wanted to find a way to detect errors in the data.
The solution lay in the control of parity. 8 bits in a byte are added, and their sum was either an even or odd. For each bit to create additional control bit - parity bit. If the amount of bits in a byte has an even, the parity bit recorded unit, otherwise - zero.
The method is very simple, but also very inefficient. We can not say which of the bits in a byte was recorded incorrectly. Perhaps check bit enrolled himself wrong? Double fault also could simply rush.
Now where memory is more reliable, and more conventional computers do not use the Parity. However, there are still very demanding of system reliability (banking, energy and so on). There is used a special type of memory called ECC (Error Correcting Code Memory). algorithms similar to thoseThat are used in the ECC, allow with absolute precision to detect each bit is incorrect and to correct the value to true.
RAID
Despite active transition to solid state drives (SSD), magnetic hard disk drives (HDD) are still the main information storage method. They are much cheaper, and the value per bit of information stored in them yet unattainable for SSD.
HDD has in its structure and movable elements is naturally one of the most frequently emerging from the system devices in the computer. If you have never in my life faced with the fact of the failed hard disk, you are either very young or extremely lucky.
In the case of the storage of sensitive data, it is necessary to apply to the most efficient, though not the most favorable decision - that data is not lost in the event of failure of one disk, you need to store them in parallel on two or more drives.
An alternative and slightly more efficient method of finance is to split the data on different disks and records checksums on these discs. All RAID meaning based on the assumption that the failure of one disk can happen at any time, but the failure of two - far less likely. As soon as the single drive detects a problem, it is the hope of the normal operation of the remaining discs, broken brother is removed and put in place a new disc. Then poured on him the information and the system continues to work as it should.
Originally the acronym RAID meant «Redundant Array of Inexpensive Disks». The meaning lies in the use of cheaper and less reliable drives. It was clear that the disks fail, but in view of storing data, such wheels summarily treated cheaper than the more expensive, and relatively more reliable wheels.
Now that the hard drives in general have become much more reliable, RAID value itself has changed. Now it «Redundant Array of Independent Disks».
Such measures are, of course, necessary, and we, if we look at it from the perspective of the life of the individual, easily able to project such methods for daily activities - different checklists, the todo-management, remayndery, podorgat door once locked her key. All this checking for errors and attempts to avoid them.