
Ask HN: Proper way to generate confirmation numbers - reaperducer
I&#x27;ve noticed that when I pay my bills online there doesn&#x27;t seem to be any single method of generating confirmation numbers. One credit card uses a 4-digit number. Another uses 9 letters.  The electric company uses six alphanumeric characters.  Are there best practices for this sort of thing, or is everyone winging it?
======
computator
Whatever format you choose, I'd like to suggest that you include a small bit
of identifying info at the beginning of the number. For example, if your
company name is Fictitious Enterprises, your confirmation numbers will always
begin with "fe", as in fe7623. Or, have the confirmation numbers always begin
with, say, "88", as in 887623. This tiny piece of redundancy is tremendously
helpful for customer support staff and for your programs to recognize that a
customer is giving the wrong number. In web forms, you can also prompt people
to enter the number beginning with "fe" or "88". It's not the norm, but
there's plenty of precedent for putting in a redundant prefix like this.

And for heaven's sake, keep the number to a reasonable length, and if longer
than 6 digits, break it up with hyphens, and make sure that all your web forms
accept the number with or without the hyphens if copied & pasted. I've seen
confirmation numbers, order numbers, etc., that run to absurd 30 or 60 or more
digits, enough to encode all the protons on Earth. There are always cases when
you can't copy & paste (like from screenshots, paper printouts, one device to
another, spoken over the phone), so you don't want crazy lengths.

