conversions.base64_to_binary¶
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 base64 value to its binary equivalent. |
Module Contents¶
- conversions.base64_to_binary.base64_to_bin(base64_str: str) str¶
Convert a base64 value to its binary equivalent.
>>> base64_to_bin("ABC") '000000000001000010' >>> base64_to_bin(" -abc ") '-011010011011011100' >>> base64_to_bin(" a-bc ") Traceback (most recent call last): ... ValueError: Invalid base64 string. Invalid char - at pos 1 >>> base64_to_bin("") Traceback (most recent call last): ... ValueError: Empty string was passed to the function
- conversions.base64_to_binary.B64_TO_BITS¶