Skip to content

Commit

Permalink
Use md5 from hashlib instead of hash().
Browse files Browse the repository at this point in the history
  • Loading branch information
gmsoft-tuxicoman committed Oct 13, 2022
1 parent 2882216 commit fb6b8a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mycroft/skills/mycroft_skill/mycroft_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from os.path import join, abspath, dirname, basename, exists
from pathlib import Path
from threading import Event, Timer
from hashlib import md5

from xdg import BaseDirectory

Expand Down Expand Up @@ -1046,7 +1047,8 @@ def register_entity_file(self, entity_file):
if not filename:
raise FileNotFoundError('Unable to find "{}"'.format(entity_file))

name = '{}:{}_{}'.format(self.skill_id, basename(entity_file), str(hex(abs(hash(entity_file))))[2:])
name = '{}:{}_{}'.format(self.skill_id, basename(entity_file),
str(md5(entity_file.encode('utf-8')).hexdigest()))
self.intent_service.register_padatious_entity(name, filename)

def handle_enable_intent(self, message):
Expand Down

0 comments on commit fb6b8a8

Please sign in to comment.