Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'nbxmpp/modules/security_labels.py')
-rw-r--r--nbxmpp/modules/security_labels.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nbxmpp/modules/security_labels.py b/nbxmpp/modules/security_labels.py
index adcfe0e..a07d7ea 100644
--- a/nbxmpp/modules/security_labels.py
+++ b/nbxmpp/modules/security_labels.py
@@ -18,6 +18,7 @@
from typing import Dict
from dataclasses import dataclass
+import hashlib
from nbxmpp.protocol import Iq
from nbxmpp.simplexml import Node
@@ -150,6 +151,10 @@ class SecurityLabel:
return cls(displaymarking=displaymarking, label=label)
+ def get_label_hash(self) -> str:
+ sha = hashlib.sha512()
+ sha.update(str(self.label).encode())
+ return sha.hexdigest()
@dataclass
class Catalog: