coopcycle-web
coopcycle-web copied to clipboard
Rethink order codes to reduce chance of similar codes
With high volume we get confusing codes. For some reason, there is a significant amount of chronology in the way the codes are created.
I would propose that instead of the 1st two digits almost being 100% chronological, randomizing all 4 letter/digits and removing letters that often can be confusing. these would include the letters i, L, e, o, v or u, q, p or f, and m or n, and leave all the numbers
instead of getting what is seen in the photo below, we should have more like
3W10 7N8B 5RNU
etc
The idea is to use Crockford's Base32 instead of Base36
I think this is where the change may take place https://github.com/coopcycle/coopcycle-web/blob/57549ee25157b6289928f94b0de85ba30fba1c27/src/Sylius/Order/OrderNumberAssigner.php
Also worth looking at
https://github.com/maksverver/key-encoding
So...it's still basically the same
We eliminated some letters that seem similar to numbers, but the main thing would be to make the first two digits also change. right now we effectively only use the 3rd and 4th digits because the others are useless.
I took a look, other platforms use 3 digit codes, but the codes actually are different The number of B and E in that photo seems a bit nuts too
repeat of #3770 closing