xep_0384: b64 helpers
This commit is contained in:
parent
af662289dd
commit
e7bad69fc7
1 changed files with 9 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
|||
import logging
|
||||
|
||||
from slixmpp.jid import JID
|
||||
import base64
|
||||
from slixmpp.plugins.xep_0384.stanza import OMEMO_BASE_NS
|
||||
from slixmpp.plugins.xep_0384.stanza import OMEMO_DEVICES_NS, OMEMO_BUNDLE_NS
|
||||
from slixmpp.plugins.base import BasePlugin, register_plugin
|
||||
|
@ -22,6 +23,14 @@ except ImportError as e:
|
|||
HAS_OMEMO = False
|
||||
|
||||
|
||||
def b64enc(data):
|
||||
return base64.b64encode(bytes(bytearray(data))).decode('ASCII')
|
||||
|
||||
|
||||
def b64dec(data):
|
||||
return base64.b64decode(data.decode('ASCII'))
|
||||
|
||||
|
||||
class XEP_0384(BasePlugin):
|
||||
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue