You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the generation of the unique orderId and customerId for NPG I thought to proceed from the timestamp in milliseconds by concatenating random way N characters between URI safe alphanumeric values.
I ruled out concurrency problems in generating the two ids in the same millisecond through a probability calculation described as follows.
Consider the length of the timestamp string in milliseconds = 13
So the random string to be generated will be 18 (maximum length of the unique id) - 13 = 5 characters
Suppose we have 2000 RPS on the service (very large number of requests) so 2 requests per millisecond.
The number of alphanumeric characters used to generate the random string is 65.
const val ALPHANUMERICS: String =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._"
We calculate all possible combinations $65^5 = 1 160 290 625$.
At this point $1 / 1 160 290 625 = 0.000000000861853$ (negligible probability of collision).
The text was updated successfully, but these errors were encountered:
For the generation of the unique orderId and customerId for NPG I thought to proceed from the timestamp in milliseconds by concatenating random way N characters between URI safe alphanumeric values.
I ruled out concurrency problems in generating the two ids in the same millisecond through a probability calculation described as follows.
Consider the length of the timestamp string in milliseconds = 13
So the random string to be generated will be 18 (maximum length of the unique id) - 13 = 5 characters
Suppose we have 2000 RPS on the service (very large number of requests) so 2 requests per millisecond.
The number of alphanumeric characters used to generate the random string is 65.
We calculate all possible combinations$65^5 = 1 160 290 625$ .
At this point$1 / 1 160 290 625 = 0.000000000861853$ (negligible probability of collision).
The text was updated successfully, but these errors were encountered: