» » number

 
Sort articles by: Date | Most Rates | Most Views | Comments | Alphabet

Use PHP generate a unique membership number

Author: bamboo06 on 4-11-2014, 03:55, views: 10321

40 When we want a huge number of data, while the median number have restrictions, such as license plate numbers 5, 10 of a document number, serial number of orders, short URL, etc., we can use the 36-ary calculated not repeat the numbers in line with the median.
Use PHP generate a unique membership number

We will use 0-Z (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) to represent the values ​​0-35, such as the letter Z represents 35. So I want to get a five numbers, the greatest amount of information is 36 5 th, and 36 ^ 5 = 60,466,176, which is equivalent to the maximum number of five decimal numbers: 60466176.
In order to do presentations in this article, we assume that a group of 10 paid a club membership number, membership number by three city ID card encoding +2 +5 bit checksum components. City number with area code indicated as 755 representatives of Shenzhen, five card numbers from card number consisting of 36 hexadecimal, followed by two check code is generated by a certain algorithm is able to use the checksum to verify the card number legitimacy. In this case, we generate 10 card number corresponds to the maximum to meet the 60 million membership number, and is not repeated unique card number.

Category: PHP Scripts / Javascript