How to use the pybase64.encodebytes 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)