def _pad_b64(b64):
    """Fix padding for base64 value if necessary"""
    pad_len = len(b64) % 4
    if pad_len != 0:
        missing_padding = (4 - pad_len)
        b64 += '=' * missing_padding
    return b64