def complete_hybi00(headers, challenge):
 key1 = headers['Sec-WebSocket-Key1']
 key2 = headers['Sec-WebSocket-Key2']
 first = (int(''.join((i for i in key1 if (i in digits)))) // key1.count(' '))
 second = (int(''.join((i for i in key2 if (i in digits)))) // key2.count(' '))
 nonce = pack('>II8s', first, second, challenge)
 return md5(nonce).digest()

def complete_hybi00 ( headers , challenge ) : key1 = headers [ 'Sec-WebSocket-Key1' ] key2 = headers [ 'Sec-WebSocket-Key2' ] first = ( int ( '' . join ( ( i for i in key1 if ( i in digits ) ) ) ) // key1 . count ( ' ' ) ) second = ( int ( '' . join ( ( i for i in key2 if ( i in digits ) ) ) ) // key2 . count ( ' ' ) ) nonce = pack ( '>II8s' , first , second , challenge ) return md5 ( nonce ) . digest ( )
generate the response for a hybi-00 challenge .