diff --git a/backend/app/services/bambu_mqtt.py b/backend/app/services/bambu_mqtt.py index c3b75e427..318b1ac50 100644 --- a/backend/app/services/bambu_mqtt.py +++ b/backend/app/services/bambu_mqtt.py @@ -1053,7 +1053,7 @@ class BambuMQTTClient: f"{ams_unit.get('id')}:{tray.get('id')}:" f"{tray.get('tray_type')}:{tray.get('tag_uid')}:{tray.get('remain')}" ) - ams_hash = hashlib.md5(":".join(ams_hash_data).encode()).hexdigest() + ams_hash = hashlib.md5(":".join(ams_hash_data).encode(), usedforsecurity=False).hexdigest() # Only trigger callback if AMS data actually changed if ams_hash != self._previous_ams_hash: diff --git a/backend/app/services/github_backup.py b/backend/app/services/github_backup.py index 3321a9d10..b137f3a66 100644 --- a/backend/app/services/github_backup.py +++ b/backend/app/services/github_backup.py @@ -535,7 +535,9 @@ class GitHubBackupService: for path, content in files.items(): content_str = json.dumps(content, indent=2, default=str) content_bytes = content_str.encode("utf-8") - content_sha = hashlib.sha1(f"blob {len(content_bytes)}\0".encode() + content_bytes).hexdigest() + content_sha = hashlib.sha1( + f"blob {len(content_bytes)}\0".encode() + content_bytes, usedforsecurity=False + ).hexdigest() # Skip if file hasn't changed if path in existing_files and existing_files[path] == content_sha: