Cap the length of a generated id