blob: 11cc69c81231f68f1b2dfa2fb6476d8f23eb50f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
from robot.api.deco import keyword
import base64
class Base64Keywords(object):
""" Utilities useful for generating UUIDs """
def __init__(self):
super(Base64Keywords, self).__init__()
@keyword
def base64_encode(self, string_to_encode):
"""generate a base64 encoded string"""
return base64.b64encode(string_to_encode.encode("utf-8"))
@keyword
def base64_decode(self, string_to_decode):
"""decode a base64 encoded string"""
return base64.b64decode(string_to_decode.encode("utf-8"))
|