Refactor. exports generate_hotp and generate_totp