[motorola-security] Add auto method (#475)

Based on https://gist.github.com/ab/67c6343530c6b8e599f07cedccbcba3d.

Closes #277.
This commit is contained in:
Marc Wrobel
2025-07-26 17:53:13 +02:00
parent ed2dd0308e
commit e1e93dc841
2 changed files with 60 additions and 0 deletions

View File

@@ -133,4 +133,5 @@ def to_identifier(s: str) -> str:
"""Convert a string to a valid endoflife.date identifier."""
identifier = s.strip().lower()
identifier = identifier.replace(" ", "-")
identifier = re.sub(r"-+", "-", identifier)
return re.sub(r"[^a-z0-9.\-+_]", "", identifier)