We have a module install script that auto-generates content types.
The content type machine names are based on text field data inputted by a user using a custom form. For example:
User title = 'Technical' => Auto-generated machine name = technical_comp
User title = 'Specialist Claims' => Auto-generated machine name = specialist_claims_comp
… and so on.
For the module to be robust, it needs to create unique 32 character machine names where there are two text fields with the same data.
Is there best practice around this?
I was thinking something along the lines of:
User title = Technical => Auto-generated machine name = a1_comp
User title = Specialist Claims => Auto-generated machine name = a2_comp
… which would give us plenty of scope but would require some kind of content type count.