def _ComputeOTP(secret, t):
 h = hmac.new(base64.b32decode(secret), struct.pack('>Q', t), hashlib.sha1)
 hash = h.digest()
 offset = (struct.unpack('B', hash[(-1)])[0] & 15)
 truncated_hash = struct.unpack('>I', hash[offset:(offset + 4)])[0]
 truncated_hash &= 2147483647
 truncated_hash %= _VERIFY_MODULUS
 return truncated_hash

def _ComputeOTP ( secret , t ) : h = hmac . new ( base64 . b32decode ( secret ) , struct . pack ( '>Q' , t ) , hashlib . sha1 ) hash = h . digest ( ) offset = ( struct . unpack ( 'B' , hash [ ( - 1 ) ] ) [ 0 ] & 15 ) truncated_hash = struct . unpack ( '>I' , hash [ offset : ( offset + 4 ) ] ) [ 0 ] truncated_hash &= 2147483647 truncated_hash %= _VERIFY_MODULUS return truncated_hash
computes the hmac hash of the user secret .