coopcycle / coopcycle-web

Logistics & marketplace platform. Only for worker-owned business.
https://coopcycle.org
Other
565 stars 128 forks source link

Rethink order codes to reduce chance of similar codes #3829

Closed Paul-Eraman-CoopCycle closed 5 months ago

Paul-Eraman-CoopCycle commented 10 months ago

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

image

alexsegura commented 10 months ago

The idea is to use Crockford's Base32 instead of Base36

r0xsh commented 10 months ago

I think this is where the change may take place https://github.com/coopcycle/coopcycle-web/blob/57549ee25157b6289928f94b0de85ba30fba1c27/src/Sylius/Order/OrderNumberAssigner.php

alexsegura commented 10 months ago

Also worth looking at

https://github.com/maksverver/key-encoding

Paul-Eraman-CoopCycle commented 7 months ago

So...it's still basically the same

image

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

Paul-Eraman-CoopCycle commented 5 months ago

repeat of #3770 closing