tests/unit/test_keycard.py
def bench_hashers():
	'''Quick benchmark for the different hash algorithms'''
	entry = make_test_userentry()

	# Clear the User signature to avoid skewing the results
	entry.generate_hash('BLAKE2-256')

	iterations = 25000
	print(f'Times for {iterations} iterations of each hash algorithm:')
	for hasher in ['BLAKE2B-256', 'SHA-256', 'SHA3-256']:
		start = time.time()
		for _ in range(iterations):
			entry.generate_hash(hasher)
		stop = time.time()
		print(f'{hasher}:\t{stop-start}')
Quick benchmark for the different hash algorithms
Quick benchmark for the different hash algorithms
Quick benchmark for the different hash algorithms
def bench_hashers():
	entry = make_test_userentry()
	entry.generate_hash('BLAKE2-256')
	iterations = 25000
	print(f'Times for {iterations} iterations of each hash algorithm:')
	for hasher in ['BLAKE2B-256', 'SHA-256', 'SHA3-256']:
		start = time.time()
		for _ in range(iterations):
			entry.generate_hash(hasher)
		stop = time.time()
		print(f'{hasher}:\t{stop-start}')
def bench_hashers ( ) : entry = make_test_userentry ( ) entry . generate_hash ( 'BLAKE2-256' ) iterations = 25000 print ( f'Times for {iterations} iterations of each hash algorithm:' ) for hasher in [ 'BLAKE2B-256' , 'SHA-256' , 'SHA3-256' ] : start = time . time ( ) for _ in range ( iterations ) : entry . generate_hash ( hasher ) stop = time . time ( ) print ( f'{hasher}:\t{stop-start}' )
Quick benchmark for the different hash algorithms
Quick benchmark for the different hash algorithms
'''Quick benchmark for the different hash algorithms''' # Clear the User signature to avoid skewing the results