def generate_certificate_id(common_name) -> str:
    """
    Generates a readable unique id for a cert based on cert's CN
    """
    name = common_name.lower().strip()
    name = re.sub(r'[^a-z0-9-]', '_', name)
    name = name[:50]  # leave space for random id
    return f"{name}-{uuid.uuid4().hex}"[:63]  # Truncate to 63 characters, to fit the api constraints

    Generates a readable unique id for a cert based on cert's CN
    
lemur/plugins/lemur_google_ca/plugin.py