forked from platypush/platypush
Generate event ID as true random strings, not MD5 hashes of UUIDs
This commit is contained in:
parent
c77746e278
commit
41acf4b253
1 changed files with 2 additions and 5 deletions
|
@ -1,10 +1,9 @@
|
||||||
import copy
|
import copy
|
||||||
import hashlib
|
|
||||||
import json
|
import json
|
||||||
|
import random
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import uuid
|
|
||||||
|
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
|
@ -79,9 +78,7 @@ class Event(Message):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _generate_id():
|
def _generate_id():
|
||||||
"""Generate a unique event ID"""
|
"""Generate a unique event ID"""
|
||||||
return hashlib.md5(
|
return ''.join(['{:02x}'.format(random.randint(0, 255)) for _ in range(16)])
|
||||||
str(uuid.uuid1()).encode()
|
|
||||||
).hexdigest() # lgtm [py/weak-sensitive-data-hashing]
|
|
||||||
|
|
||||||
def matches_condition(self, condition):
|
def matches_condition(self, condition):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue