def _lscmp(a, b):
 return ((not sum(((0 if (x == y) else 1) for (x, y) in zip(a, b)))) and (len(a) == len(b)))

def _lscmp ( a , b ) : return ( ( not sum ( ( ( 0 if ( x == y ) else 1 ) for ( x , y ) in zip ( a , b ) ) ) ) and ( len ( a ) == len ( b ) ) )
compares two strings in a cryptographically save way: runtime is not affected by length of common prefix .