Hrm... here's where my CS knowledge lets me down. I want to write an algorithm that generates a reference number that is unique.
I don't want to use sequential numbers as they introduce a security risk and I want to use alphanumerics. The ref will have a min and max length too. (I can't use a GUID it is too long)
Ideally I don't want to query my persistence layer to see if a ref has been used before.
What strategies can I employ?