Hide your autoincrement ID #īaseline, whenever you need to hide your autoincerment ID it is best to use a random number or pattern that is hard if not impossible to guess. The same example can be applied for customer ID or shipment ID or any other integer identifier that increments by 1. That is why exposing auto-increment IDs is bad. Just with the order id which is an autoincrement integer your competitor, possibly unknowingly is giving out a vital business metric to anyone who can do some due diligence. Averaging at 367.66 orders per day, you can easily do the math for each week. You can quickly do the math that your competitor has (111050-100020) 11030 orders in 30 days. If the order ID on the first day of the month is 100020 and the order ID on the last day of the month is 111050. Now to know the order volume of your competitor all you need to do is order on the first day of the month and the last day of the month. You have found out that the order ID used by your competitor is an autoincrement integer primary key. Get your competitor’s order volume example #įor example, you have an e-commerce website and you have a fierce competitor. There are other great usages of UUID but hiding the autoincrement ID stands out in my opinion. A sequential auto-increment ID can reveal much more than you intended. They can also be used to act as a hash which can be decoded back to an integer or other identifier. UUID is a great way to hide sequential database IDs. Given we have that mentioned, in the next section we will look into why and when to use a UUID. Any prior knowledge of unique IDs and their usage will be beneficial but not essential.Able to use NPM to install some NPM modules would be very helpful.The latest LTS version of Node.js is expected which is 16 at the time of writing this. You will need Node.js working on your machine and some knowledge of how to work with Node.js is essential. Prior to jumping into the code, below are some of the things best to have in order to run the code examples in the later sections. Get your competitor’s order volume example.In this post, you will learn how to generate a UUID using Node.js and briefly understand when and why to use them. UUID can be very useful as reliable unique identifiers. One of them is with a native module and others are using NPM packages. In Node.js there are many ways to generate a UUID. Universally Unique Identifier (UUID) is very useful.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |