<s> import hmac <EOL> import time <EOL> from base64 import b64decode <EOL> from struct import pack , unpack <EOL> from hashlib import sha1 <EOL> def generateAuthCode ( secret ) : <EOL> counter = int ( time . time ( ) ) // <NUM_LIT:30> <EOL> secret = b64decode ( secret ) <EOL> counter = pack ( '<STR_LIT>' , counter ) <EOL> hash = hmac . new ( secret , counter , sha1 ) . digest ( ) <EOL> offset = ord ( hash [ <NUM_LIT> ] ) & <NUM_LIT> <EOL> fullcode = ( unpack ( "<STR_LIT>" , hash [ offset : offset + <NUM_LIT:4> ] ) [ <NUM_LIT:0> ] & <NUM_LIT> ) <EOL> chars = '<STR_LIT>' <EOL> code = '<STR_LIT>' <EOL> for i in range ( <NUM_LIT:5> ) : <EOL> code += chars [ fullcode % len ( chars ) ] <EOL> fullcode /= len ( chars ) <EOL> return code </s>
