Several rules for naming coupon codes: 1. No duplication. 2. Security. Your order number cannot reveal your company’s real operating information. For example, if your order is a serial number, then others can infer your company’s overall operation summary from the order number. Therefore, the order code must be basically incomprehensible to others except for a few people in your company. Referring to the coding rules of JD.com and Taobao, others will basically not be able to figure out what it means. In fact, the best anti-leak coding rule is not to add any data related to company operations in the coding. 3. Large-scale random codes cannot be used. When many people analyze the order encoding rules, the first thought is definitely non-repetitive uniqueness, then the second thought may be security, and the third thought that satisfies the first two is random code. Because large-scale random codes are randomly generated, there is no need to leak them because they are meaningless. But in fact, this coding rule will have big problems in implementation. The random code meets the second security requirement. In order to meet the first non-repetitive feature, you have to compare the historical data to see if there are any duplications when generating the random code. If your order quantity reaches 100,000 times, you will When generating order codes, you have to compare 100,000 pieces of historical data. You can imagine the huge problems this will cause. But can’t random codes be used in encoding? Small-scale random codes can be used, such as 2 to 3 digits. This kind of random code is generally used in combination with serial numbers. Its main function is to hide the real data of the serial number. 4. Prevent concurrency. This rule is mainly for time settings in coding. 5. Number of control digits. This is easy to understand. The purpose of the order number is to facilitate inquiry. Generally, the normal usage scenario should be when there is an abnormality in the order or when the order is returned, the user will report the order number to the customer service, and the customer service will inquire. So it is generally better to be in the 10th to 15th place. 10th on JD.com and 15th on Taobao.
Taobao order number
2016-04-28 Order number: 1846204025999235
2016-04-28 Order number: 1846669615349235
2016-04-27 Order number: 1846164650079235
2016-04-27 Order number: 1845531842409235
2016-04-26 Order number: 1840290749419235
2012-07-29 Order number: 148557304839235
Several rules for naming coupon codes:
1. No duplication.
2. Security.
Your order number cannot reveal your company’s real operating information. For example, if your order is a serial number, then others can infer your company’s overall operation summary from the order number. Therefore, the order code must be basically incomprehensible to others except for a few people in your company. Referring to the coding rules of JD.com and Taobao, others will basically not be able to figure out what it means. In fact, the best anti-leak coding rule is not to add any data related to company operations in the coding.
3. Large-scale random codes cannot be used.
When many people analyze the order encoding rules, the first thought is definitely non-repetitive uniqueness, then the second thought may be security, and the third thought that satisfies the first two is random code. Because large-scale random codes are randomly generated, there is no need to leak them because they are meaningless. But in fact, this coding rule will have big problems in implementation.
The random code meets the second security requirement. In order to meet the first non-repetitive feature, you have to compare the historical data to see if there are any duplications when generating the random code. If your order quantity reaches 100,000 times, you will When generating order codes, you have to compare 100,000 pieces of historical data. You can imagine the huge problems this will cause.
But can’t random codes be used in encoding? Small-scale random codes can be used, such as 2 to 3 digits. This kind of random code is generally used in combination with serial numbers. Its main function is to hide the real data of the serial number.
4. Prevent concurrency.
This rule is mainly for time settings in coding.
5. Number of control digits.
This is easy to understand. The purpose of the order number is to facilitate inquiry.
Generally, the normal usage scenario should be when there is an abnormality in the order or when the order is returned, the user will report the order number to the customer service, and the customer service will inquire.
So it is generally better to be in the 10th to 15th place.
10th on JD.com and 15th on Taobao.
Generate 16-digit UUID
This is currently done, but it always feels inconvenient. This coupon needs to be printed out, and the user may need to manually enter @jiangxiao
https://www.zhihu.com/question/19805896
Time + user ID + product/store ID to which the coupon belongs + random code
Sensitive information can be md5 or other algorithms