How to use the pybase64.b64decode function in pybase64

To help you get started, we’ve selected a few pybase64 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mayeut / pybase64 / pybase64 / __main__.py View on Github external
def benchmark(args):
    print(__package__ + ' ' + pybase64.get_version())
    data = readall(args.input)
    for altchars in [None, b'-_']:
        for validate in [False, True]:
            print('bench: altchars={0:s}, validate={1:s}'.format(
                  repr(altchars), repr(validate)))
            bench_one(args.duration,
                      data,
                      pybase64.b64encode,
                      pybase64.b64decode,
                      pybase64.encodebytes,
                      altchars,
                      validate)
            bench_one(args.duration,
                      data,
                      base64.b64encode,
                      b64decodeValidate,
                      b64encodebytes,
                      altchars,
                      validate)
github slazarov / python-bittrex-websocket / bittrex_websocket / _auxiliary.py View on Github external
def process_message(message):
    try:
        deflated_msg = decompress(b64decode(message, validate=True), -MAX_WBITS)
    except SyntaxError as e:
        deflated_msg = decompress(b64decode(message, validate=True))
    except TypeError:
        # Python2 doesn't have validate
        deflated_msg = decompress(b64decode(message), -MAX_WBITS)
    return loads(deflated_msg.decode())
github mayeut / pybase64 / pybase64 / __main__.py View on Github external
def decode(args):
    data = readall(args.input)
    data = pybase64.b64decode(data, args.altchars, args.validate)
    writeall(args.output, data)
github slazarov / python-bittrex-websocket-aio / bittrex_websocket / _auxiliary.py View on Github external
async def process_message(message):
    try:
        deflated_msg = decompress(b64decode(message, validate=True), -MAX_WBITS)
    except SyntaxError:
        deflated_msg = decompress(b64decode(message, validate=True))
    return loads(deflated_msg.decode())
github slazarov / python-bittrex-websocket / bittrex_websocket / _auxiliary.py View on Github external
def process_message(message):
    try:
        deflated_msg = decompress(b64decode(message, validate=True), -MAX_WBITS)
    except SyntaxError as e:
        deflated_msg = decompress(b64decode(message, validate=True))
    except TypeError:
        # Python2 doesn't have validate
        deflated_msg = decompress(b64decode(message), -MAX_WBITS)
    return loads(deflated_msg.decode())