Module: check_mk
Branch: master
Commit: 8bda0e931435ef59b15dcf8e76b8ee0926ec0aed
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8bda0e931435ef…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Wed May 9 14:33:01 2018 +0200
Use hashlib instead of builtin hash function in DropdownChoice
Change-Id: I81c60cf4cee435ac381d7cdef4f57b98b32bd731
---
web/htdocs/valuespec.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 3fdf752..886c442 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1673,9 +1673,9 @@ class DropdownChoice(ValueSpec):
return options
- @classmethod
- def option_id(cls, val):
- return "%s" % hash(repr(val))
+ @staticmethod
+ def option_id(val):
+ return "%s" % hashlib.sha256(repr(val)).hexdigest()
def validate_value(self, value, varprefix):