conversions.binary_to_base64 ============================ .. py:module:: conversions.binary_to_base64 .. autoapi-nested-parse:: * Author: Siddharth Singh (https://github.com/coolsidd) * Description: Convert a binary string to Base64. References for better understanding: https://en.wikipedia.org/wiki/Base64 Attributes ---------- .. autoapisummary:: conversions.binary_to_base64.BITS_TO_B64 Functions --------- .. autoapisummary:: conversions.binary_to_base64.bin_to_base64 Module Contents --------------- .. py:function:: bin_to_base64(bin_str: str) -> str Convert a binary value to its base64 equivalent >>> bin_to_base64("000001") 'AB' >>> bin_to_base64("0") 'A' >>> bin_to_base64("1") 'B' >>> bin_to_base64("-1") '-B' >>> bin_to_base64(" -000001 ") '-AB' >>> bin_to_base64("0-0") Traceback (most recent call last): ... ValueError: Non-binary value was passed to the function >>> bin_to_base64("") Traceback (most recent call last): ... ValueError: Empty string was passed to the function .. py:data:: BITS_TO_B64