Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)