Internal function to efficiently iterate over the hashes
    
    Regular string compare will bail at the earliest opportunity
    which allows timing attacks

def _safe_str_cmp(a, b):
    """
    Internal function to efficiently iterate over the hashes
    
    Regular string compare will bail at the earliest opportunity
    which allows timing attacks
    """
    if len(a) != len(b):
        return False
    rv = 0
    for x, y in zip(a, b):
        rv |= ord(x) ^ ord(y)
    return rv == 0