added utility to make macs loggable

This commit is contained in:
Patrick762 committed 2023-08-26 18:01:05 +02:00
1 parent e0c7ada147
commit 43be1e1dbe
10 files changed
+57 -42

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
"""Tools."""
def mac_loggable(mac: str) -> str:
"""Remove parts of the mac address for logging."""
splitted = mac.split(":")
return "XX:XX:XX:XX:XX:" + splitted[-1]
def unique_id_loggable(unique_id: str) -> str:
"""Remove parts of the unique id for logging."""
splitted = unique_id.split("_", maxsplit=1)
serial = splitted[0][:6]
return serial + "XXXXXXXXXX" + splitted[1]