conversions.binary_to_base64¶
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¶
Functions¶
|
Convert a binary value to its base64 equivalent |
Module Contents¶
- conversions.binary_to_base64.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
- conversions.binary_to_base64.BITS_TO_B64¶