I often made such encoders.
I'm rather good at C and Delphi.
mockup provided.
with 6 digits, that give almost an address space of 20 bits so I would make a reversible binary encryption of the date and a sequence number.
resulting values greater than 999999 (about 10%; 2^20 minus one million) should be rejected.
you'll have to explain more about the size parameter. will it be 333 pins in each size each day, or 1000 pins per size, or custom arrangement (one selected size for each pin)