in reply to Algoritm for converting string to number?
What are the chances of there being two or more of your textual product codes clashing if you transformed them by:
If the chances of a collision are low -- and I think they would probably be so low as to be considered negligible -- then you can have a mapping function to a 64-bit int that will cover 36**13 (170,581,728,179,578,208,256) product ids, which is probably enough to be going on with.
Some will say that relying on 'negligible risk' is still "too dangerous", completely failing to recognise that every digest, UUID/GUID etc. relies on exactly that principle.
|
|---|