Choosing a shortcode checksum to prevent input errors

I need to select a checksum algorithm to detect when users mistakenly wrote code with 4 characters [A-Z0-9] by adding 1 character at the end of the code (also in [A-Z0-9]).

Summing up ASCII codes and using the module is a bad decision, since inverting 2 keystrokes will not be noticed.

I would probably use the Fletcher algorithm, but I would like to know if anyone knows the algorithm developed for this use case (a very small number of bytes, depending on the position)?

Thank.

+5
source share

All Articles