This commit is contained in:
Scott Sadler
2018-03-28 15:02:20 -03:00
parent 9e74de25fc
commit 991c422a9d
91 changed files with 12158 additions and 2480 deletions

View File

@@ -114,11 +114,15 @@ def decode_base64(data):
def encode_base64(data):
return base64.urlsafe_b64encode(data).rstrip(b'=')
if type(data) == str:
data = data.encode()
return base64.urlsafe_b64encode(data).rstrip(b'=').decode()
def b16_to_b64(b16):
return encode_base64(base64.b16decode(b16)).decode()
if type(b16) == str:
b16 = b16.encode()
return encode_base64(base64.b16decode(b16))
def _read_vectors(name):