'Entropy based algorithm
http://en.wikipedia.org/wiki/Password_strength'

def is_csrf_token(self, key, value):

    min_length = 5
    min_entropy = 2.4
    if (len(value) <= min_length):
        return False
    for common_csrf_name in COMMON_CSRF_NAMES:
        if (common_csrf_name.lower() in key.lower()):
            return True
    entropy = self.shannon_entropy(value.encode('utf8', errors='ignore'))
    if (entropy >= min_entropy):
        return True
    return False
