Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def binary_base64encode(data):
'''
Base64 encode byte strings.
:param str data: Binary string to encode.
:return: Base64 encoded data.
:rtype: str
'''
_validate_message_type_bytes(data)
return b64encode(data).decode('utf-8')