import base64
import logging


def check_b64(b64):
    """ Function checks if string is base64 and not empty
   
    :param b64: base64 string
    :raises TypeError: if input is not base64
    :raises ValueError: if input is empty
    """
    try:
        if (base64.b64encode(base64.b64decode(b64)) == b64):
            return True
        else:
            pass
    except:
        logging.info('not recieving base64 input')
        raise TypeError("input is not base64")